Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi,
any body please help about this question.
i am designing one form.In that i am having feilds like first name,middle name,last name.in those feilds i want to add validators like 2 letters not allowed,only alphabtets are allowed and spaces,special characters not allowed like this.
how can i get this.

thanks in advance.
Posted

Hey dear,
first try google fro this found 1,170,000 result within second,
I personnally recomment a this article of code project for using validation controls
Validator Controls in ASP.NET[^]
This article rpovide even code that you can used for your purpose.
And validating Special characters you should well understand the WILDCARDS
For More information please read MSDN and your asp.net notes

If you have any confusion then asked
Best of luck
 
Share this answer
 
Comments
leelavathikuna 23-Apr-11 5:30am    
thank u.
[no name] 23-Apr-11 5:33am    
Its ok
Prasanta_Prince 23-Apr-11 6:33am    
Good one.
[no name] 23-Apr-11 6:42am    
Thanks Prasanta
There are various types of validation for ASP.NET server controls[^].

The MSDN link lists all of them and also contains detailed information and example for each of them.

In your case you will probably RegularExpressionValidator[^] or you may write your custom validation.

To read more about validation controls, see here - ASP.NET Validation Controls[^].

You may also search Google for "validation on asp.net" if you need more options and details.

Hope this helps!
 
Share this answer
 
v2
Comments
leelavathikuna 23-Apr-11 5:30am    
thank u.
Prasanta_Prince 23-Apr-11 6:33am    
GOod one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900