日期:2014-05-20 浏览次数:20826 次
<tr class="b"> <td class="style1" align="center">价格</td> <td class="style2"> <asp:TextBox ID="txtPrice" runat="server"></asp:TextBox> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtPrice" ErrorMessage="*请输入正确的价格" ValidationExpression="(0|([1-9]\d*))(\.\d+)?" Display="Dynamic" ValidationGroup="Vpro"> </asp:RegularExpressionValidator> </td> </tr> <td class="style2"> <asp:Button ID="btnSubmit" runat="server" Text="提交" onclick="btnSubmit_Click" OnClientClick="return check(this)" ValidationGroup="Vpro"/> </td>
function check(obj) { if (Page_ClientValidate()) { //你的代码 return true; } else { return false; } }
------解决方案--------------------