RE: Button click once

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ibrahim Shameeque (IbrahimShameeque_at_discussions.microsoft.com)
Date: 08/23/04


Date: Mon, 23 Aug 2004 01:07:01 -0700

Hi
Place button1.enabled = false on the button click event. This will disable
the button after postback, because, the click event is only processed after
postback. Thanks
Ibrahim

"Jon Booth" wrote:

> Hi All,
> I'm trying to create a button that once clicked will disable itself (so as
> not to be clicked twice)
>
> I have the following in my cs
> Button1.Attributes.Add("onClick","return
> document.Form1.Button1.disabled=true;");
>
> It disables the button but does not perform the post back. What am I doing
> wrong?
>
> If I remove the line it posts back fine.
>
> Thanks
> Jon
>
>
>
>



Relevant Pages

  • Re: Button click once
    ... You might also want to investigate this technique: ... > not to be clicked twice) ... > It disables the button but does not perform the post back. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [stable] Wanted: Allow adding new device IDs during the -stable cycle
    ... > Jon Masters told me this last week at FreedomHEC, ... > pointer to the patch that disables it, ... which is why I was so surprised when Jon said it. ...
    (Linux-Kernel)
  • Re: Server Side ASP button
    ... This disables the button, however, the server side event handler code is not executed. ... "Bruno Alexandre" wrote in message ... "a Portuguese in Denmark" ... There is a slight delay in the process between the submit button and the postback. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Button click once
    ... Jon Booth wrote: ... > (so as not to be clicked twice) ... It disables the button before the actual postback, ... one of the solutions was to use visibility instead of disabled. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Double submit
    ... attach an ONCLICK event that disables the button once clicked. ... You can't disable a button once the postback has begun and, if you disable it first, the postback won't actually happen... ...
    (microsoft.public.dotnet.framework.aspnet)