Author: plnelson | Posted on: 1/3/2009 11:29:14 PM | Views : 255

I'm just learning this stuff after years writing desktop apps, so I've made a "control-o-rama" .aspx page in Visual Studio including a button and a textbox, each with their own handler, just to learn it.    But when I hit enter in the textbox its handler gets called and THEN the button handler gets called even though I never clicked the button!   What's up with that - why is the button's OnClick handler being called? 

 
Here's the relevant part of the .aspx code
. . .
  <asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>&nbsp;<br />

  <asp:Button ID="Button1" runat="server" Text="Button" Width="86px" OnClick="Button1_Click" OnClientClick="OnClientClick" />

. . .

 Thanks in ...

Go to the complete details ...