在ASP.Net prevent重复回传(C#) [英] Prevent duplicate postback in ASP.Net (C#)

查看:100
本文介绍了在ASP.Net prevent重复回传(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里简单的一...有$ P $的pventing从用户一个干净的方式双击Web表单按钮,从而造成重复事件火?

Simple one here... is there a clean way of preventing a user from double-clicking a button in a web form and thus causing duplicate events to fire?

如果我有相关的评论的形式,并在用户键入这是我的意见,并点击提交,评论如下...但是如果他们双击,三击,或只是去坚果键盘就可以导致多个版本的发布。

If I had a comment form for example and the user types in "this is my comment" and clicks submit, the comment is shown below... however if they double-click, triple-click or just go nuts on the keyboard they can cause multiple versions to be posted.

客户端,我可以很容易的onclick禁用按钮 - 但我喜欢$该p $ PFER服务器端解决方案的事情:)

Client-side I could quite easily disable the button onclick - but I prefer server-side solutions to things like this :)

有每个视图状态回发超时,可以例如设置?

Is there a postback timeout per viewstate that can be set for example?

感谢

推荐答案

我不认为你应该加载像这些琐碎的任务服务器。你可以尝试像的1件事的一些jQuery UI的封闭液。微软Ajax工具包也应该有一定的控制,做同样的。我已经用它很久以前,不能似乎记得,虽然该控件的名称。

I dont think that you should be loading the server for trivial tasks like these. You could try some thing jquery UI blocking solution like this one. Microsoft Ajax toolkit should also have some control which does the same. I had used it a long time ago, cant seem to recall the control name though.

这篇关于在ASP.Net prevent重复回传(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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