Length Validation with Regular Expressions in ASP.NET or

length validator in asp.net

<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
<td colspan="2">
<asp:TextBox Width="250px" ID="TextBox1" runat="server" TextMode="Password"></asp:TextBox>
<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}.*" />

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

www.code-sample.com/. Powered by Blogger.