失效按钮防止双击

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

1) <asp:Button runat="server" ID="btnPayBook"  onclick="btnPayBook_Click" 
          Text="Book" Width="97px" OnClientClick="disableBtn(this);" />

2) Page.ClientScript.GetPostBackEventReference(btnPayBook,"OnClick");

3) <script type="text/javascript">
       function disableBtn(btn) {
        btn.value = 'Processing...';
        btn.disabled = 'disabled';
        __doPostBack("btnPayBook", "OnClick");
       //doPostBack can now fire serverside event even if button is disabled
       }                                                         
  </script>

4.) Its explaind in instructions above 


5.)<script type="text/javascript">
         function ResetButton() {
                                           
          var btn = document.getElementById("btnPayBook");
             if (btn.disabled == true) {
               btn.disabled = false;
            }
         }
      </script>