Question problem, two asp buttons are working as one, don't want that

RC1007

New member
Joined
Oct 28, 2009
Messages
2
Programming Experience
Beginner
I've got one form in a masterpage en here i've got one asp:button with a submit function that sends data to my mail for now. And then I made a contactform in a contentpage with a asp:button.Herefore is a second submitbutton. All code behind vb.net(the function)

Problem: when i click on the submitbutton of my contactform, the submitbutton from my masterpage will respond as well. They work as one. I don't want that. They must have there own function. How can i solve this? When I click one of them, the button must only do the things, the validations, it must do for that part. This is my masterpage aspx:
VB.NET:
<asp:Panel ID="Panel1" runat="server" Width="100%" DefaultButton="btnSubmit">
<div id="main">
<form runat="server" defaultbutton="btnSubmit">

    <table>
        <tr>
            <td align="left" valign="top">
                <div id="leftContainer">
                    <div id="newsLetter"><span class="kopLeftMenu">NIEUWSBRIEF</span>
                        <div id="mainMailing">
                            <asp:TextBox ID="tbMailing" runat="server" Text="<enter email-address here...>" Width="200px"/>
                            <asp:Label id="labelSucces" runat="server" Visible="false" />
                            
                            <asp:ValidationSummary ID="valsumMail" runat="server" DisplayMode="SingleParagraph" /></span>
                        </div>   
                        <div style="float:right; margin-right: 15px; padding-top: 6px;">
                            <asp:Button ID="btnSubmit" runat="server" Text="Verzenden" TabIndex="1"/></div>
                  
            </td>       
            <td align="left" valign="top">
                
                <div>
                <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

                </asp:ContentPlaceHolder>
                </div>
              
            </td>
        </tr>
    </table>

here my contactform aspx:
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server" DefaultButton="btnSubmit2">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:panel ID="Panel1" runat="server" Width="100%" DefaultButton="btnSubmit2">
<div id="inhoud">
<table>
<tr>
<td>
<div>
<div></div>
<div style="padding-top: 3px;"><asp:Label AssociatedControlID="name" runat="server">Naam</asp:Label></div>
<div style="padding-top: 12px;"><asp:Label AssociatedControlID="email" runat="server">E-mailadres</asp:Label></div>
<div style="padding-top: 67px;"><asp:Label AssociatedControlID="description" runat="server">Boodschap</asp:Label></div>
</div>
</td>
<td>
<div>
<asp:RadioButtonList ID="tbTitleDhrMevr" runat="server" RepeatDirection="Horizontal">
<asp:ListItem>Dhr.</asp:ListItem>
<asp:ListItem>Mevr.</asp:ListItem>
</asp:RadioButtonList>
</div>
<div>
<asp:TextBox id="name" runat="server" />
</div>
<div style="padding-top: 1px;">
<asp:TextBox id="email" runat="server" />
</div>
<div style="padding-top: 1px;">
<asp:TextBox id="description" runat="server" Height="100px" Width="250px" TextMode="MultiLine" />
</div>
</td>
</tr>
</table>
<div style="float:right;"><asp:Button ID="btnSubmit2" runat="server" Text="Verzenden" TabIndex="2" /></div>
<div><asp:Label id="labelSucces" runat="server" Visible="false"></asp:Label></div>
<div><span><asp:ValidationSummary ID="valsumName" runat="server" DisplayMode="BulletList" /></span></div>

the code for my submitbutton is written in code behind, like this:
Protected Sub btnSubmit2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit2.Click
'... code
end Sub

PLEASE HELP ME OUT OF THIS
 
Back
Top