可能难做。
用 RegularExpress 来判断吧,在输入焦点离开文本框时将不是数字的内容清除。

解决方案 »

  1.   

    Put this code in your Page_Load function
    only number can be acceptedTextBox1.Attributes.Add("onkeyup",@"value=value.replace(/[^\d]/g,'')");
    TextBox1.Attributes.Add("onbeforepaste",@"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))");
      

  2.   

    用有效验证方式:
    例如:
    <asp:ReguarExpressValidator id="RegularExpressionValidator" runat=Server"
    ContrloToValidate="TextBox1"
    ValidationExpression="^[\w-}+@[\w\]+\.(com|net|org|mil|cn...)$"
    Disply="static"
    ......
    </asp:ReguarExpressValidator>
    这个不用说,你也知道是验证什么的。
    关键是要知道验证规则如何写。
      

  3.   

    更正错误:
    ValidationExpression="^[\w-}+@[\w\]+\.(com|net|org|mil|cn...)$"
    为:
    ValidationExpression="^[\w-]+@[\w\]+\.(com|net|org|mil|cn...)$"
      

  4.   

    在文本框中关闭输入法,这样可以使它不能输入中文,不过复制进去的得再处理!
    <asp:textbox id="TextBox1" style="IME-MODE: disabled;" runat="server"/>
      

  5.   

    //判断是否包含汉字
    function comprise_CC(textbox)
    {
    if (/[^\x00-\xff]/g.test(textbox.value)) alert("包含有汉字");
    }