防止双击asp.net向导下一步按钮单击。 [英] Prevent double click on asp.net wizard next button click.

查看:73
本文介绍了防止双击asp.net向导下一步按钮单击。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!



我需要阻止asp.net向导下一步按钮的额外点击。原因是:有一个程序,将数据保存到数据库,如果用户开始垃圾邮件发送下一个按钮,数据将被保存一次以上,导致错误。我试过谷歌,但我没有找到任何有用的东西,所以如果有人遇到这个问题,请帮忙。



感谢您的回答。

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.

推荐答案

在<$ c $之后立即禁用该按钮c>单击事件处理程序,因此只需单击一次,当您想允许单击时再次启用它,例如,当向导的下一页准备就绪时。



-SA
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


我不确定你提到的向导,但这种情况的良好做法是直到最后一步才能保存任何东西。您可以在会话中保留所有用户输入。
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.


这篇关于防止双击asp.net向导下一步按钮单击。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆