• Twitter
  • Facebook
  • Google+
  • Instagram
  • Youtube

Saturday, March 17, 2007

Use Validation Expression of Field Validators in Asp.Net

Validation Expression for Field Validator
======================================
1. Multiple E-Mail Validation [ Separated by Semicolon ';' ]
( For Regular Expression Validator )

^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+
([;.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$

2. Multiple E-Mail Validation
( For Regular Expression Validator )

\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+
([-.]\w+)*\.\w+([-.]\w+)*)*

3. File Exteansion Validator ( For Regular Expression Validator )

^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.jpg|.jpeg|.gif|.bmp|.tif|.png)$

4. Validate only Numeric Fields. ( For Regular Expression Validator )

^([0-9]{1,})$

5. Price / Amount Validation
( For Regular Expression Validator )

[0-9]{0,3}\.{0,1}[0-9]{0,2}
(^\d*\.?\d*[0-9]+\d*$)|(^[0-9]+\d*\.\d*$)
^\d+(?:\.\d{0,2})?$
(^\d*\.\d{2}$)

6. Wesite Address Validation ( For Regular Expression Validator )

(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?

0 comments:

Contact

Get in touch with me


Adress/Street

12 Street West Victoria 1234 Australia

Phone number

+(12) 3456 789

Website

www.johnsmith.com