1. 程式人生 > >Asp.net button防止點擊多次數據提交

Asp.net button防止點擊多次數據提交

popu -s rac -a func nat btn display put

??

<!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>

Asp.net button防止點擊多次數據提交