Hi All,
I have webpage with the following fields
EmpID- Allow only numeric
Name-Allow only Characters
Department-Allow only with in the list(DropDownList)
Designation-Allow only characters
Phone-In the format of "99999 99999"
EmailID- In the format of [email protected]
Here,
Except Phone remaining fields are mandatory.
So i need to validate this page before submitting it..
Can any body suggest me how can i put custom validation for this?
Custom Validations for ASP .Net Web page
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Krishna GaradRank #191 · 12.8K reputationPosted Jan 24, 2012, 2:41 AM EST
EmpId-->Use Compare Validator
Operator="DataTypeCheck" Type="Integer">
For Name as above change only Type to String
Department requiredfiled
Designation as above comparevalidator set type=string
Email Id-->Regular Expression Validator
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">