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

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2009
Posts: 1
Reputation: RC1007 is an unknown quantity at this point 
Solved Threads: 0
RC1007 RC1007 is offline Offline
Newbie Poster

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

 
0
  #1
30 Days Ago
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:
  1. <asp:Panel ID="Panel1" runat="server" Width="100%" DefaultButton="btnSubmit">
  2. <div id="main">
  3. <form runat="server" defaultbutton="btnSubmit">
  4.  
  5. <table>
  6. <tr>
  7. <td align="left" valign="top">
  8. <div id="leftContainer">
  9. <div id="newsLetter"><span class="kopLeftMenu">NIEUWSBRIEF</span>
  10. <div id="mainMailing">
  11. <asp:TextBox ID="tbMailing" runat="server" Text="<enter email-address here...>" Width="200px"/>
  12. <asp:Label id="labelSucces" runat="server" Visible="false" />
  13.  
  14. <asp:ValidationSummary ID="valsumMail" runat="server" DisplayMode="SingleParagraph" /></span>
  15. </div>
  16. <div style="float:right; margin-right: 15px; padding-top: 6px;">
  17. <asp:Button ID="btnSubmit" runat="server" Text="Verzenden" TabIndex="1"/></div>
  18.  
  19. </td>
  20. <td align="left" valign="top">
  21.  
  22. <div>
  23. <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
  24.  
  25. </asp:ContentPlaceHolder>
  26. </div>
  27.  
  28. </td>
  29. </tr>
  30. </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">
<aspanel 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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC