views:

97

answers:

3

In my web form I have a Textbox control. The TextChanged event of the Textbox is not triggering. AutoPostBack is set to true

What could be the reason for this? Here is the code:

protected void Textr_TextChanged(object sender, System.EventArgs e)
{

}

<asp:TextBox ID="Textr" TabIndex="10" Style="z-index: 117; left: 500px;
                            position: absolute; top: 158px" runat="server" Height="22px" Width="180px" MaxLength="50"
                            AutoPostBack="True"   CausesValidation="true"   OnTextChanged="Textr_TextChanged" 
                          ></asp:TextBox>
+1  A: 

Are there any validation controls on the form along with this textbox? I see you have causesvalidation explicitly set to true (which I believe is the default state). Try removing that and see if it fires. If the postback is hung up on a validation control, your event handler will not fire.

My two cents.

Andy Evans
no :( not working even after removing causesvalidation.
stacknewbee
A: 

Is it working in rest browsers? Don't forget that this event is fired then control is loosing focus. :) Try to click outside of textbox after inputing.

Danil
Yes try to have 2 TextBoxes and change the one with the event and Tab out of it to the next TextBox. See if this fires the event or not.
sh_kamalh
I have IE8, I'm using IE7 emulation feature and it is working well for me. Do you have testing code? Can you share it?
Danil
A: 

it may be messed up by some javascript you are using on the same page, or else you can make sure yourself if it is IE7 problem or not by making a sample for this. Very high level it looks like sonething related to javascript mess up.

Nits