944,020 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 292
  • VB.NET RSS
Oct 28th, 2009
0

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

Expand Post »
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 Syntax (Toggle Plain Text)
  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:
Quote ...
<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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RC1007 is offline Offline
1 posts
since Oct 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: validating data in vb.net
Next Thread in VB.NET Forum Timeline: About VB.Net ?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC