Thursday, March 22, 2012

Text1_LostFocus event for ASP.NET project

This is my understanding, however I haven't been able to find confirmation in print. So I'm hoping someone will be able to confirm or deny this.

I have an ASP.NET project with a text box on it. When it loses focus, I want to fire the LostFocus event. The Lost_Focus event is unavailable. I assume this is because I have set the text box to run as a server control. Is this correct?

If this is correct, does that mean I have to create some client side scripting to handle this event? If so, what is the best way to accomplish this?

Thanks,

PardoIf your use server side TextBox control, you may try this:


TextBox1.Attributes.Add("onfocusout", "javascript:alert(""Test"")")

Try the onTextChanged event
OnTextChanged="YourRoutine"

- then use AutoPostback="True"

0 comments:

Post a Comment