ASP.NET(vb.net) & RegularExpressionValidator - asp:RegularExpressionValidator : Evaluates the value of an input control to determine whether it matches a pattern defined by a regular expression.
ShotDev Focus:
- ASP.NET(vb.net) & RegularExpressionValidator
Tag Control
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="RegularExpressionValidator"></asp:RegularExpressionValidator>
Example
RegularExpressionValidator.aspx
<%@ Page Language="VB" %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <form id="form1" runat="server"> Input Email<br /> <asp:TextBox id="txtEmail" runat="server"></asp:TextBox> <asp:RegularExpressionValidator id="myRegValid" runat="server" ErrorMessage="Please input [Email]" ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator><br /> <asp:Button id="btnSubmit" runat="server" Text="Submit" /> </form> </body> </html>
Screenshot