468,253 Members | 1,286 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,253 developers. It's quick & easy.

Handling multiple postbacks to a page

I have an aspx page with a textbox and an "add to my Account Button." when
the button is pushed, my program adds the amount in the textbox to the
database which, lets say takes a few seconds. If the user rapidly clicks on
the "add to my Account Button" it generates multiple postbacks, which I
believe all get processed asyncronously.

I don't want for it to work this way. I don't want the user to be able to
issue another postback until I have issued a response.

Is there anyway I can make this happen?
thanks
T
Nov 19 '05 #1
3 1826
Client side, disable the button just before submit. Also, set
a flag to prevent the form itself from being submitted multiple times.

http://www.eggheadcafe.com/PrintSear....asp?LINKID=98

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:u0****************@TK2MSFTNGP12.phx.gbl...
I have an aspx page with a textbox and an "add to my Account Button." when
the button is pushed, my program adds the amount in the textbox to the
database which, lets say takes a few seconds. If the user rapidly clicks
on the "add to my Account Button" it generates multiple postbacks, which I
believe all get processed asyncronously.

I don't want for it to work this way. I don't want the user to be able to
issue another postback until I have issued a response.

Is there anyway I can make this happen?
thanks
T

Nov 19 '05 #2
Try using the OneClick control to prevent this.

http://www.metabuilders.com/Tools/OneClick.aspx

I use it in my apps. Works fine.
--
Joe Fallon


"Tina" <ti**********@nospammeexcite.com> wrote in message
news:u0****************@TK2MSFTNGP12.phx.gbl...
I have an aspx page with a textbox and an "add to my Account Button." when
the button is pushed, my program adds the amount in the textbox to the
database which, lets say takes a few seconds. If the user rapidly clicks
on the "add to my Account Button" it generates multiple postbacks, which I
believe all get processed asyncronously.

I don't want for it to work this way. I don't want the user to be able to
issue another postback until I have issued a response.

Is there anyway I can make this happen?
thanks
T

Nov 19 '05 #3
Robbe,
I implemented that javascript on my page that has (1) a button that causes a
postback and database update and (2) a dropdown that has autopostback - true
that will also cause a postback and a database update. The javascript code
works fine if the button is hit multiple times but does now work if the
dropdown is rapidly changed.

Would you know why an how this might be fixed?
Thanks,
T
"Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message
news:e4**************@TK2MSFTNGP10.phx.gbl...
Client side, disable the button just before submit. Also, set
a flag to prevent the form itself from being submitted multiple times.

http://www.eggheadcafe.com/PrintSear....asp?LINKID=98

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:u0****************@TK2MSFTNGP12.phx.gbl...
I have an aspx page with a textbox and an "add to my Account Button."
when the button is pushed, my program adds the amount in the textbox to
the database which, lets say takes a few seconds. If the user rapidly
clicks on the "add to my Account Button" it generates multiple postbacks,
which I believe all get processed asyncronously.

I don't want for it to work this way. I don't want the user to be able
to issue another postback until I have issued a response.

Is there anyway I can make this happen?
thanks
T


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by john | last post: by
1 post views Thread by Chris Beach | last post: by
2 posts views Thread by Adrian Parker | last post: by
1 post views Thread by Mardy | last post: by
reply views Thread by Mike P | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.