Hi,
How to work with Custom Validator in ASP.NET? In which type of application it is used?
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Dec 29, 2011, 4:17 AM
Please refer the below links
http://www.w3schools.com/aspnet/control_customvalidator.asp
http://asp.net-tutorials.com/validation/custom-validator/
http://www.beansoftware.com/ASP.NET-Tutorials/Validation-Controls.aspx
Thanks
Priya LingePosted Dec 29, 2011, 1:44 AM
1.CustomValidator
Performs user-defined validation on an input control.
The control allows you to validate both clientside and serverside, where the serverside approach is probably
the most powerful.
2.Example :
Check the length of the string in the TextBox using CustomValidator.
Custom text:
protected void cusCustom_ServerValidate(object sender, ServerValidateEventArgs e)
{
if(e.Value.Length == 8)
e.IsValid = true;
else
e.IsValid = false;
}
Hope this will help you.
Thanks.