I have a Model popup form with a button which is coded to send an email. When I click on the button, it first opens another Model Form and fires off the same code on this new form.

Not sure why it's opening a new form, there is no code anywhere to do so. Here is the code for my button:

<asp:Button ID="cmdSend" 
            runat="server" 
            Font-Bold="True"
            ForeColor="#000066"
            style="margin-bottom: 0px" 
            Text="SEND" Width="88px" />

Here is the vb code behind the button:

Protected Sub cmdSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSend.Click
        Dim answer As Integer
        Dim strAtt1 As String
        Dim strAtt2 As String
        Dim Rep As Long

        Rep = Me.txtRepID.Text

I placed a breakpoint at the Rep line and a new form opens before it fires off the cmdSend_Click.

Is there somethine I'm missing?

Thanks for your help!
LaDeana

Tha handles cmdSend.cmdSend.Click is not right it should only be cmdSend.Click. I am not sure how it got this way. Try taking out the first cmdSend. and see if that helps

Thank you for your response. The handles only has one cmdsend.click. Also here is the vb code I'm using to open the form from another asp page:

Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        If e.CommandName = "EmailToClient" Then
            Session("JobNo") = e.CommandArgument
            Dim script As String
            script = "<script>window.showModalDialog('EmailForm.aspx', window, 'status:false;dialogWidth:580px;dialogHeight:540px');</script>"
            ScriptManager.RegisterStartupScript(UpdatePanel1, Type.GetType("System.String"), "javascript", script, False)
        End If

I am new to .net and trying to learn as I work on this new project. I wish we could debug each step, but it seems to just skip over into the opening of this form.

Thanks so much for your help! LaDeana

Hey dear friend
you should use cmdsend.click in your program.

live news channel

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.