Quick ASP.NET form email validation
A combination of a RequiredFieldValidator and a RegularExpressionValidator to validate email addresses on forms:
<asp :TextBox ID="txtEmail" RunAt="Server" />
<asp :RequiredFieldValidator
ID="reqEmail"
RunAt="server"
ControlToValidate="txtEmail"
ErrorMessage="Email Address required" />
<asp :RegularExpressionValidator
ID="reqAuthEmail"
RunAt="server"
ControlToValidate="txtEmail"
ValidationExpression="^[\w-\.]+@([\w-]+\.)+[\w-]{2,3}$"
ErrorMessage="Valid Email Address required" />


How would you install this and use it? Do you have to have ASP for it? Could you tell me what I would need to use this code for my site? Thanks!
@Spencer: You can use this on any ASP.NET form.
The code for the regularexpressionvalidator was exactly what I was looking for. Thanks.
Thanks Man this realy good ..
Thank you very much for this code
Thank you very much! Your code works perfectly, I was having a headache trying to make my code function. ;)
Thanks, This is very helpful
“Mmm regex hauuughggugh” (that’s my homer impression) Thanks for this, works wonderfully.