|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
asp button click handlerHi
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 client first, then server sequentially. why do you have this long processing
on the client? -- Show quoteHide quoteRegards, 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 > > 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 >> >> > > 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. -- Show quoteHide quoteRegards, 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:#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 > >> > >> > > > > > >
Understanding query strings
CSS class for a div tag Referencing controls in a template programmatically Control.Controls bug? Control's child controls missing at the run time. Master Detail w Multiple Keys Tree View DragNode onload called only once preserve password field over steps in wizard validation controls are not working Events not fired for Dynamically Created Controls in VS2005 ASP.NET 2.0 |
|||||||||||||||||||||||