Click here to Skip to main content
15,906,574 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

I have a problem where Textbox event is not firing after postbacks of a page.

The textbox is placed in a Updatepanel.

I am using the text box to enter zipcodes and fill the cities dropdown accordingly.

In the page.. we have some validation..

before checking the validation... the textchanged event is firing.

but after checking validations..that is after postbacks..the textxhanged event is not firing.


I tried using

txtCode.TextChanged += new EventHandler(txtCode_TextChanged);
...in pageload.


but didnt work.

Can anyone help me in solving .


Thank you,
yashoda
Posted
Updated 28-Apr-11 21:35pm
v2
Comments
Ankit Rajput 29-Apr-11 3:36am    
EDIT: Code block added for better understanding
bandayashoda 29-Apr-11 4:49am    
protected void txtCode_TextChanged(object sender, EventArgs e)
{
try
{
//Function to get the City Details
GetCity();
}
catch (Exception ex)
{}
Ankit Rajput 29-Apr-11 3:37am    
Can you please provide some code?
bandayashoda 29-Apr-11 4:50am    
protected void txtCode_TextChanged(object sender, EventArgs e)
{
try
{
//Function to get the City Details
GetCity();
}
catch (Exception ex)
{
Hemant__Sharma 29-Apr-11 6:18am    
Well you need to provide full code i.e. how the text box is placed where are you attaching the event handler and so on. The code sample you gave here wont be of any help because if the text chagned event is not getting fired you wont come inside it.

Thanks
Hemant

1 solution

Hello Bandayashoda,

Did you try adding text_changed event in text tag of your .aspx page?
Did you try adding event handler statement in page's preinit?

Somehow the binding of your textbox's change event is not happening or the information to raise the event is not passed to the textbox control during request processing.

Well you need to provide some code to better understand the issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900