Length Validation with Regular Expressions in ASP.NET or


length validator in asp.net

<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
</td>
<td colspan="2">
<asp:TextBox Width="250px" ID="TextBox1" runat="server" TextMode="Password"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="PasswordRequired" ForeColor="Red" runat="server"
ControlToValidate="Password" ErrorMessage="Required" ValidationGroup="Login2"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server"
ControlToValidate="Password" ForeColor="Red" ErrorMessage="Minimum length is 8" ValidationGroup="Login2" ValidationExpression=".{8}.*" />
</td>
</tr>
ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.