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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity bundle 8 47
How can I use this extension method? 8 47
Align Buttons next to each other 2 25
How to get the web content with different encodings 2 27
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…
User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Sending a Secure fax is easy with eFax Corporate ( First, just open a new email message. In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

17 Experts available now in Live!

Get 1:1 Help Now