How to allow Minimum of 5 and Maximum of 7 letters in a Textbox?

 Posted by vishalneeraj-24503 on 7/8/2014 | Category: ASP.NET Interview questions | Views: 2061 | Points: 40
Answer:

We will write below code:-
<asp:TextBox Id = "txt_employee_code" runat = "server"></asp:TextBox>


<asp:RegularExpressionValidator Display = "Dynamic" ControlToValidate = "txt_employee_code" Id = "reg_ex_employee_code" ValidationExpression = "^[\s\S]{5,7}$" runat = "server" ErrorMessage =

"Minimum of 5 and Maximum of 7 letters allowed only"></asp:RegularExpressionValidator>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Sheonarayan on: 2/23/2015 | Points: 10
Good one.

Cool.

Login to post response