I have a web application, with a user control.
In my user control I have a TextBox:
<asp:TextBox ID="Value" runat="server" ontextchanged="TextBox_TextChanged"
ondisposed="Value_Disposed" onload="Value_Load" ></asp:TextBox>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
}
Very simple but it doen't work!
It's skip on the function TextBox_TextChanged!
Please help!!!!:confused:
4 replies to this topic
#1
Posted 15 March 2011 - 05:17 AM
|
|
|
#2
Posted 17 March 2011 - 12:36 AM
The TextBox Web server control does not raise an event each time the user enters a keystroke, only when the user leaves the control.
By default, the TextChanged event does not immediately cause the Web Forms page to be posted to the server. Instead, the event is raised in server code the next time the form is posted.
By default, the TextChanged event does not immediately cause the Web Forms page to be posted to the server. Instead, the event is raised in server code the next time the form is posted.
#3
Posted 17 March 2011 - 03:25 AM
Yes, I know it.
I put a break point in that function(TextBox_TextChanged)
and I noticed that I never enterd to this function,
even in postback.
That is my problem.
I put a break point in that function(TextBox_TextChanged)
and I noticed that I never enterd to this function,
even in postback.
That is my problem.
#4
Posted 17 March 2011 - 05:26 AM
Works fine here, so I'm not sure what to tell you. Are you sure something in your OnLoad event isn't derailing your code?
#5
Posted 17 March 2011 - 06:10 AM
Follow Momerath's advice. Make sure that your code isn't breaking before the event is called. You may also want to make sure that you actually registered the event in your .cs file. You should have a section in the .cs file like this:
Hope this helps.
override protected void OnInit( EventArgs e )
{
base.OnInit( e );
txtValue.TextChanged += new EventHandler( txtValue_TextChanged );
}
Hope this helps.
-CDG10620
Software Developer
Software Developer
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









