TextBox只能输入数字设置示例 //TextBox为输入QQ号码为例设置 <asp:TextBox ID="txtQQ" runat="server" Font-Size="9pt" Width="150px" BackColor="White" MaxLength="13"></asp:TextBox>xxx.net/tags/11/1/ //使用正则表达式控件输入是否为数字 *<asp:RegularExpressionValidator ID="revTxtMphone0" runat="server" ControlToValidate="txtQQ" ErrorMessage="您输入的号码有误,请重新输入" Font-Size="9pt" ValidationExpression="^\d+$">QQ号码只能输入数字</asp:RegularExpressionValidator>
$('#<%=txtCodeSeq.ClientID%>').keypress(NumberText).blur(NumberText); 强迫症患者的人,就用js来绑定事件吧
$('#<%=txtCodeSeq.ClientID%>').keypress(NumberText).blur(NumberText);
txt.Attribute.Add("keypress","<script>客户端方法</script>")
110,536
社区成员
642,578
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧