Solved

Prevent multiple submits from the finish button in a wizard

Posted on 2006-11-29
4
276 Views
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.
Thanks
Chad
0
Comment
Question by:ChadMarsh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:Collindsouza
ID: 18036987
have you tried using this one..

http://www.codeproject.com/aspnet/DisableSubmitButton.asp

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

Really easy to implement
0
 
LVL 2

Author Comment

by:ChadMarsh
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
Chad
0
 
LVL 52

Accepted Solution

by:
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
            }
            else
            {
                // Page has been submitted once, show message, etc
            }
    }
0
 
LVL 2

Author Comment

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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