Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 特定按钮onclick的jquery验证_Asp.net_Jquery - Fatal编程技术网

Asp.net 特定按钮onclick的jquery验证

Asp.net 特定按钮onclick的jquery验证,asp.net,jquery,Asp.net,Jquery,我正在asp.net中使用jquery客户端验证 我现在面临的问题是,每当我单击页面中的任何按钮时,都会导致验证,而不仅仅是针对特定的按钮 如何解决这个问题 谢谢您想使用event.preventDefault 假设您有两个按钮SubmitButton和CancelButton,并且您不希望CancelButton触发验证插件,只需为CancelButton指定CssClass=cancel <asp:Button ID="CancelButton" runat="server"

我正在asp.net中使用jquery客户端验证

我现在面临的问题是,每当我单击页面中的任何按钮时,都会导致验证,而不仅仅是针对特定的按钮

如何解决这个问题

谢谢

您想使用event.preventDefault


假设您有两个按钮SubmitButton和CancelButton,并且您不希望CancelButton触发验证插件,只需为CancelButton指定CssClass=cancel

    <asp:Button ID="CancelButton" runat="server" 
            Text="Return to List" 
            CssClass="cancel" />

你能澄清一下吗。“每当我点击页面中的任何按钮时,它都会导致验证,而不仅仅是特定的按钮”是什么意思?谢谢你,纳文..它很有效..如果你能解释确切的原因的话?@SAK:Jörn Zaeffer设计了这样的插件。我没有看到任何文件,虽然
    <asp:Button ID="CancelButton" runat="server" 
            Text="Return to List" 
            CssClass="cancel" />