Asp.net button防止点击多次数据提交



<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>

    <title></title>

    <script src="jquery-1.5.min.js"></script>

    <script>

        function btnServerSaveClick() {

            $("#btnSave").val("正在提交数据...");

            $("#btnSave").attr("disabled", "disabled");

            var ClientBtnSaveID = '<%=btnServerSave.ClientID %>';

            $("#" + ClientBtnSaveID + "").click();

        }

    </script>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <div style="display:none">

        <asp:Button ID="btnServerSave" runat="server" Text="Button" OnClick="btnServerSave_Click" />

            </div>

        <input type="button" value="保存" id="btnSave" onclick="btnServerSaveClick();" />

    </div>

    </form>

</body>

</html>

原文地址:https://www.cnblogs.com/blfbuaa/p/6915544.html