View Complete Thread
  • Re: ASP - Disable a button to prevent user from clicking twice

    Jan 22, 2014 02:49 AM|Angie xu - MSFT|LINK


    According to your description above, you want to disable button to prevent double click in ASP, 

    Code in page(.aspx):

    <html xmlns="">
    <head runat="server">
        <script language="javascript" type="text/javascript">
            var submit = 0;
            function CheckIsRepeat() {
                if (++submit > 1) {
                    alert('An attempt was made to submit this form more than once; this extra attempt will be ignored.');
                    return false;
        <form id="form1" runat="server">
            <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" OnClientClick="return CheckIsRepeat();" />

    For further information: Disable a button to avoid double clicks-

    Best regards


    Angie xu

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.