Prevent multiple submits from the finish button in a wizard

Posted on 2006-11-29
Last Modified: 2008-02-01
Hello Experts,
I have a registration page that I set up using a wizard control. The only problem is sometimes the user clicks the finish button more then once
and I get duplicate records in my database.  I've found tons of posts on disabling a submit button but it seems like it's a little harder then throwing some javascript on a submit button.  I'm having a hard time accessing the finish button within the wizard to even disable it.
Any help would be appreciated.
Question by:ChadMarsh
  • 2

Expert Comment

ID: 18036987
have you tried using this one..

I used this code many times. and works great for me..

Really easy to implement

Author Comment

ID: 18037035
Thanks for the post.  I have used that one. My problem is I can't get to the finish button to add the attribute
LVL 52

Accepted Solution

Carl Tawn earned 500 total points
ID: 18037208
You should be able to just set a Session variable on the first submit and check this with each submission to see if the form has already been submitted:

    protected void Page_Load(object sender, EventArgs e)
        if (Page.IsPostback)
            if (Session["submitted"] == null)
                Session["submitted"] = true;
                // Database work
                // Page has been submitted once, show message, etc

Author Comment

ID: 18037301
Much easier than what I was trying to do. Thank You!

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Combine two columns 3 38
Hovering effect 9 30
Why is "packages element is not declared"? 2 42 mvc foreach 3 12
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

10 Experts available now in Live!

Get 1:1 Help Now