我可以知道如何使用RegularExpressionValidator控制器在Asp.net中检查输入值时为0。然后显示错误信息?请告知
<asp:RegularExpressionValidator id="Inv_QtyREV" runat="server" ErrorMessage=" Not allow input QTY is 0, please check again !!" ValidationExpression="([0])" ControlToValidate= "Inv_Qty" />发布于 2014-01-02 05:58:25
我想你只想让文本框输入数字
使用这个正则表达式
^(?=.*[1-9])\d*\.?\d*$发布于 2014-01-02 06:13:43
你可以这样用
使用^(?=.*[1-9])\d*\.?\d*$而不是([0])
<asp:RegularExpressionValidator id="Inv_QtyREV" runat="server" ErrorMessage=" Not allow input QTY is 0, please check again !!" ValidationExpression="^(?=.*[1-9])\d*\.?\d*$" ControlToValidate= "Inv_Qty" />发布于 2014-01-02 06:17:05
使用这个
^[1-9][0-9]*$
<asp:RegularExpressionValidator id="Inv_QtyREV" runat="server" ErrorMessage=" Not allow input QTY is 0, please check again !!" ValidationExpression="^[1-9][0-9]*$" ControlToValidate= "Inv_Qty" />https://stackoverflow.com/questions/20877133
复制相似问题