Home All Groups Group Topic Archive Search About
Author
9 Dec 2005 4:16 PM
Peter Kirk
Hi

if I have an asp:button with runat=server, when it is clicked the code
behind (onclick handler) is called. If the onclick function is a long time
running, does the button wait until the handler is finished until it can be
clicked again? Or can I risk that a user can cause two executions of my
onclick handler to be executing at the same time?

Thanks,
Peter

Author
9 Dec 2005 5:29 PM
Alvin Bruney - ASP.NET MVP
client first, then server sequentially. why do you have this long processing
on the client?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Show quoteHide quote
"Peter Kirk" <p*@alpha-solutions.dk> wrote in message
news:ue$ZxvN$FHA.208@tk2msftngp13.phx.gbl...
> Hi
>
> if I have an asp:button with runat=server, when it is clicked the code
> behind (onclick handler) is called. If the onclick function is a long time
> running, does the button wait until the handler is finished until it can
be
> clicked again? Or can I risk that a user can cause two executions of my
> onclick handler to be executing at the same time?
>
> Thanks,
> Peter
>
>
Author
9 Dec 2005 9:42 PM
Peter Kirk
I do a lot of updates in a database when the user clicks the button. It
could take maybe 1 - 1½ seconds before completing.

But sometimes I am seeing double updates if I click rapidly many times on
the button. It appears that Internet Explorer can send mulitple requests
from the same browser "simultaneously". That is, it does not wait for the
server to complete the onclick handler before allowing the handler to fire
again.

Peter

Show quoteHide quote
"Alvin Bruney - ASP.NET MVP" <www.lulu.com/owc> skrev i en meddelelse
news:eDtvTYO$FHA.2520@TK2MSFTNGP15.phx.gbl...
> client first, then server sequentially. why do you have this long
> processing
> on the client?
>
> --
> Regards,
> Alvin Bruney [MVP ASP.NET]
>
> [Shameless Author plug]
> The Microsoft Office Web Components Black Book with .NET
> Now Available @ www.lulu.com/owc
> Forth-coming VSTO.NET - Wrox/Wiley 2006
> -------------------------------------------------------
>
>
>
> "Peter Kirk" <p*@alpha-solutions.dk> wrote in message
> news:ue$ZxvN$FHA.208@tk2msftngp13.phx.gbl...
>> Hi
>>
>> if I have an asp:button with runat=server, when it is clicked the code
>> behind (onclick handler) is called. If the onclick function is a long
>> time
>> running, does the button wait until the handler is finished until it can
> be
>> clicked again? Or can I risk that a user can cause two executions of my
>> onclick handler to be executing at the same time?
>>
>> Thanks,
>> Peter
>>
>>
>
>
Author
12 Dec 2005 6:35 PM
Alvin Bruney - ASP.NET MVP
in that case, you simply need to write some javascript to disable or hide
the button on the click. When the page reloads, the button will return to
its original visible state. No visible button, no possibility of
double-click.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Show quoteHide quote
"Peter Kirk" <p*@alpha-solutions.dk> wrote in message
news:#rsCFmQ$FHA.140@TK2MSFTNGP12.phx.gbl...
> I do a lot of updates in a database when the user clicks the button. It
> could take maybe 1 - 1½ seconds before completing.
>
> But sometimes I am seeing double updates if I click rapidly many times on
> the button. It appears that Internet Explorer can send mulitple requests
> from the same browser "simultaneously". That is, it does not wait for the
> server to complete the onclick handler before allowing the handler to fire
> again.
>
> Peter
>
> "Alvin Bruney - ASP.NET MVP" <www.lulu.com/owc> skrev i en meddelelse
> news:eDtvTYO$FHA.2520@TK2MSFTNGP15.phx.gbl...
> > client first, then server sequentially. why do you have this long
> > processing
> > on the client?
> >
> > --
> > Regards,
> > Alvin Bruney [MVP ASP.NET]
> >
> > [Shameless Author plug]
> > The Microsoft Office Web Components Black Book with .NET
> > Now Available @ www.lulu.com/owc
> > Forth-coming VSTO.NET - Wrox/Wiley 2006
> > -------------------------------------------------------
> >
> >
> >
> > "Peter Kirk" <p*@alpha-solutions.dk> wrote in message
> > news:ue$ZxvN$FHA.208@tk2msftngp13.phx.gbl...
> >> Hi
> >>
> >> if I have an asp:button with runat=server, when it is clicked the code
> >> behind (onclick handler) is called. If the onclick function is a long
> >> time
> >> running, does the button wait until the handler is finished until it
can
> > be
> >> clicked again? Or can I risk that a user can cause two executions of my
> >> onclick handler to be executing at the same time?
> >>
> >> Thanks,
> >> Peter
> >>
> >>
> >
> >
>
>