Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextChanged cancels Click event

Status
Not open for further replies.

LV

Programmer
Nov 1, 2000
1,184
US
I have a user control with text box and button, both wrapped into an UpdatePanel. The text box has AutoPostBack=true and OnTextChanged handler in the code behind. When the text in the text box is changed and then the button is clicked, the TextChanged handler will execute but Click event on the button won't fire. Click will only work if text is not changed. Did anyone run into this problem?
 
is the page completing the postback (via updatepanel) before the button is clicked? it may be a race condition where the click event is happening before the textchanged event completes.

it could also be what you are doing in the textchanged and click events that is causing the problem. remove the updatepanel and get it working. then apply the update panel.

are the events wired up manually (in code) or using the declarative syntax? if they are wire manually you must wire up the events with each postback.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Jason,

Thanks for the reply. The textchanged handler makes a web service call and fires an event that the parent page subscribes to, to pass some info to it and works just fine when I make a text change and tab out of it. When the button is clicked immidiately after changing text in the box, the postback completes as usual and textchanged is executed. However, it never makes it to the button click handler, even if I remove the panel an all logic from the textchanged code. The events are wired declaratively in the HTML. Pretty weird.
 
check to make sure the handlers defined in the markup are correct. it could be the button is subscribing to the textbox's textchanged event.

beyond that, I'm at a loss.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Yeah, same here. Events wired up correctly, double checked. Will keep searching for the solution, thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top