how to validate the text enter in the textbox after entering the complete in text in the textbox
-
iam having a textbox where iam entering some text say user id then after entering the userid in the textbox and if user goes for next control then how can i validate that the user id entered is already there in my db.which event of the textbox works better.
-
iam having a textbox where iam entering some text say user id then after entering the userid in the textbox and if user goes for next control then how can i validate that the user id entered is already there in my db.which event of the textbox works better.
Well, actually in asp.net you don't have an event on the validation of the control like in windows forms, but you can do like the following: 1) Put a custom validator control in your form 2) Set its ControlToValidate to your Textbox 3) Add a function to your code like
protected void ValidateTextboxInDB(object source, ServerValidateEventArgs args) { //Put the result of the validation in: //args.IsValid }
-
Bind the event handler to your method like:
OnServerValidate="ValidateTextboxInDB"
ControlToValidate="TextBox1"
ErrorMessage="Your error message.">
Regards
Intelligence is almost useless for those who have nothing else! Email: caiokf@gmail.com
-
-
Well, actually in asp.net you don't have an event on the validation of the control like in windows forms, but you can do like the following: 1) Put a custom validator control in your form 2) Set its ControlToValidate to your Textbox 3) Add a function to your code like
protected void ValidateTextboxInDB(object source, ServerValidateEventArgs args) { //Put the result of the validation in: //args.IsValid }
-
Bind the event handler to your method like:
OnServerValidate="ValidateTextboxInDB"
ControlToValidate="TextBox1"
ErrorMessage="Your error message.">
Regards
Intelligence is almost useless for those who have nothing else! Email: caiokf@gmail.com
hi caiokf Thanks for ur immediate reply .but how to call this when textbox is lost focus means when user enters something in the textbox and comes out.
-
-
hi caiokf Thanks for ur immediate reply .but how to call this when textbox is lost focus means when user enters something in the textbox and comes out.