Monday, 10 May 2010

How to create an email validator on a web page

Came across this requirement recently on an application I'm developing. Handy to know that you can easily create a regular expression to handle email formats like this:

<asp:textbox id="textbox1" runat="server">
  <asp:regularexpressionvalidator controltovalidate="textbox1" display="dynamic"
    errormessage="* Your entry is not a valid e-mail address." id="valRegEx" 
    runat="server" validationexpression=".*@.*\..*">*

No comments:

Post a Comment