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