Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.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
Javascript 如何停止服务器端功能的处理?_Javascript_Html_Asp.net_Event Handling - Fatal编程技术网

Javascript 如何停止服务器端功能的处理?

Javascript 如何停止服务器端功能的处理?,javascript,html,asp.net,event-handling,Javascript,Html,Asp.net,Event Handling,我有一个asp:按钮,它调用客户端函数。客户端函数提供确认,询问用户是否要继续。我已返回false,但它仍在继续执行服务器端函数。为什么我的客户端功能不停止进程 这是我的按钮: <asp:Button ID="btnSend" runat="server" Text="Send To Feed Mill" Height="36px" OnClick="btnSend_Click" OnClientClick="sendFeed

我有一个asp:按钮,它调用客户端函数。客户端函数提供确认,询问用户是否要继续。我已返回false,但它仍在继续执行服务器端函数。为什么我的客户端功能不停止进程

这是我的按钮:

<asp:Button ID="btnSend" runat="server" Text="Send To Feed Mill" Height="36px"
                                OnClick="btnSend_Click" OnClientClick="sendFeed_Click()" Visible="False" />
谢谢@Zack


我没有返回true或false,而是实现了preventDefault()来停止调用服务器端函数

查找
preventDefault
OK即可。谢谢,我刚试过。工作完美!
    function sendFeed_Click() {
    $('.tonnage').each(function () {
        var maxTons = $(this).data("maxtons");
        if (this.value > maxTons) {
            if (confirm("The order amount is more than the maximum. Are you sure you wish to continue?")) {
                return true;
            } else {
                return false;
            }
        }
    })
}