views:

282

answers:

1

I am building a user registration form in asp.net. I want to check if the username is available or not on the leave event of the TextBox. I am not able to get the Leave Event of the TextBox.

Should I use OnBlur event of the Html TextBox. Please Help.

A: 

How about using TextChanged server-side event and wrapping the whole thing in an UpdatePanel for very quick ajax functionality. If you use this method make sure the AutoPostBack property is set to true for the TextBox control.

Marek Karbarz
But that will fire a query on every text changed. I think this will create more load on server
vaibhav
TextChanged is only fired when the user leaves the textbox - it's not fired every time a character is entered
Marek Karbarz
oh, if thats the case, I am good to go with TextChanged. Thanks.
vaibhav