We will also use
Asp.net RegularExpressionValidator control to achieve this task:-
Refer 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,}$" runat = "server"
ErrorMessage = "Minimum of 5 letters allowed only">
</asp:RegularExpressionValidator>