如何避免双击或在按钮上单击多个以防止重复保存 [英] How can avoid double click or click more than one on a button to prevent duplicate saving

查看:487
本文介绍了如何避免双击或在按钮上单击多个以防止重复保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Web应用程序中,当我单击保存按钮上的多个按钮时,就会发生每次按下事件数据的保存.为了避免多次保存,我需要显示一条消息请稍等".

In my web application , when I click more than one on a save button , then each press event data save occurred. I need to shown a message "Please wait or like that " to avoid multi save.

推荐答案

您可以在保存后简单地禁用按钮,并在以后使用时重新启用它计时器.
You might simply disable the button after saving and re-enable it later using a timer.


您应禁用客户端单击事件上的按钮(OnClientClick ="this.disabled = true;"),并返回true,并确保按钮上的UseSubmitBehavior = false标记.
You should disable the button on client click event (OnClientClick="this.disabled=true;")and return true, and make sure that your button has UseSubmitBehavior=false on the markup.


这篇关于如何避免双击或在按钮上单击多个以防止重复保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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