Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
Hi!

I need to prevent additional clicks on an asp.net wizard next step button. The reason is: there is a procedure, witch saves data to the database, and if the users starts spamming the next button, the data will be saved more then one times, witch causes errors. I've tryed to google, but I didn't find anything usefull, so if anybody met with this problem please help.

Thank you for the answers.
Posted
Comments
Prasad Avunoori 25-Jun-14 5:17am    
Please elaborate more.
Debabrata_Das 25-Jun-14 5:20am    
Hi, can you please share your code changes?

Disable the button immediately after in its Click event handler, so only one click will be possible, enable it again when you want to allow the click, for example, when next page of the wizard is ready.

—SA
 
Share this answer
 
Comments
CHill60 25-Jun-14 16:12pm    
The old saying is true... usually the simplest solution is the best! 5'd
Sergey Alexandrovich Kryukov 25-Jun-14 17:54pm    
Thank you very much.
I prefer Einsten's "Everything should be made as simple as possible, but not simpler."
—SA
I'm not sure about the wizard you mentioned, but the good practice for such scenarios is to not save anything until the very last step. You can keep all the user input in the session until that point.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900