Tuesday, December 7, 2010

Custom Validator in asp.net

Custom validator in asp.net is very useful when showing server side error in validation group. This also makes your error message though out the application linear whether it is server side or client side.

See the below Example.

    1: Add validation Summary first  

  

 
 
 
2: Then add Custom Validator where ever you want the place.
 




 
  
        Note :  One Custom Validator is enough for showing all server side error.
 

    3 : Then in code Behind add this following line where ever you want error message to be shown.
 

 
Note : Make Validator as false before showing server side error. This way error can be shown 
to the user in more proper manner using validation Group.
 
Hope this article would be helpful for you guys "Happy Coding".