User double clicks submit button causing double postback of data. How can I stop this happening?

Hi,

I am using a server side submit button and if you double click the button twice it writes two lots of data back to the server. How can I overcome this. It dosent happen often but often enough to cause me a headache.

Your help would be greatly appreciated.

Thanks

Paul G
pgilfeatherAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gregoryyoungCommented:
There are many ways of doing this ... assigning a GUID to the request so it does not get double is a generally accepted one, you can also set a variable in session.

You can also use javascript on the button which disables it after the first click.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ihenryCommented:

In addition for gregory's suggestion on javascript, take a loot at the two articles below
http://aspzone.com/archive/2004/01/06/292.aspx
http://www.codeproject.com/aspnet/ClickOnce_Button_Control.asp
0
srcalcCommented:
yea the easiest way to fix this is simply disable the button after it is clicked
0
pgilfeatherAuthor Commented:
Thanks guys Im looking into the links.

Will return shortly
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.