RE: Button click once

Tech-Archive recommends: Fix windows errors by optimizing your registry

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


Quantcast