Answer: We will write below code in RegularExpressionValidator control to achieve.
<asp:TextBox runat="server" id="txt_version" />
<asp:RegularExpressionValidator runat="server" id="rex_version" ControlToValidate="txt_version" ValidationExpression="^[0-9]{5}$" ErrorMessage="Only Numeric values allowed" />
Asked In: Many Interviews |
Alert Moderator