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

Posted on 2004-11-05
Last Modified: 2008-02-01

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.


Paul G
Question by:pgilfeather
    LVL 37

    Accepted Solution

    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.
    LVL 20

    Assisted Solution


    In addition for gregory's suggestion on javascript, take a loot at the two articles below
    LVL 4

    Assisted Solution

    yea the easiest way to fix this is simply disable the button after it is clicked

    Author Comment

    Thanks guys Im looking into the links.

    Will return shortly

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now