Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 22, 2012 08:02 AM by RameshRajendran
Oct 01, 2009 01:06 PM|LINK
I have a textbox with autopostback=true and a button to save the data in the form.
Functionality works fine when entering a value in the textbox, tabbing out of the textbox and clicking on the save button.
But issue comes up when entering a value in the textbox and directly clicking on the save button without tabbing out of the text box.
In the second scenario, only textchanged event fires and save click event dosen't fire.
What I was expecting was after exection of textchanged event, save click event should also fire. But this is not happening.
Please, suggest me a resolution for this issue.
ASP.NET event handling
Oct 01, 2009 02:26 PM|LINK
This is true, textbox event will fires only in this case, work arround:
1 - you can make the button disabled and then enable it after the text change event fired
2- or you can disable autopostback in the textbox, and when you press the button both of them will be executed
if those suggestions wont help you, please give me more details about the textbox change event, what is the purpose of it, so I will try to think about somthing else.
Oct 01, 2009 03:08 PM|LINK
<asp:TextBox ID="txt1" runat="server" AutoPostBack="true" ontextchanged="txt1_TextChanged" />
<asp:Button ID="btn1" runat="server" Text="Click Me" onclick="btn1_Click" />
protected void btn1_Click(object sender, EventArgs e)
Oct 08, 2009 06:53 AM|LINK
Above solution dosen't work :(
First time it worked, but next time again it is not calling button click event.
Oct 08, 2009 07:52 AM|LINK
Got one solution as-
Void textbox1_TextChanged(object sender, EventArgs e)
Void Button1_click(object sender, EventArgs e)
Oct 08, 2009 08:33 AM|LINK
happy you got it..
yes i cross checked the code.. i forgot to paste it here.
Nov 22, 2012 08:02 AM|LINK