JavaScript Code:
<script type="text/javascript">
function Check(sender, e) {
if (isNaN(e.Value))
e.IsValid = false;
else
e.IsValid = true;
}
</script>
ASPX Code :
<asp:TextBox ID="TextBox1" runat="server" Width="150"></asp:TextBox>
<asp:CustomValidator ID="CustomValidator1" runat="server"
ErrorMessage="Id Should be a Number" ClientValidationFunction="Check"
ControlToValidate="TextBox1" Display="Dynamic" ForeColor="Red"
SetFocusOnError="True"></asp:CustomValidator>
No comments :
Post a Comment