ASP.NET:在 UpdatePanel 中使用回发时禁用所有控件 - 类似于 ajas 动画?
我正在使用 UpdatePanel,并且需要在使用 UpdatePanel 刷新页面时显示某种 Ajax 动画。
最好的是能够禁用所有控件并显示 ajax 加载消息。
我很乐意在所有内容的顶部放置一个 Div - 就像覆盖层一样。 Jquery UI 对话框的作用几乎相同。
有人有这方面的经验吗?
问题是用户在从回发(使用更新面板)返回之前单击项目,
提前致谢
I am using the UpdatePanel and need to display some kind of Ajax anination while the page refreshes with the UpdatePanel.
What would be great is to be able to disable all controls and display a ajax loading message..
I would love to put a Div over the top of everything - like an overlay. Jquery UI dialog box does pretty much the same.
Does anyone have any experience with this?
Problem is that users are click items before returning from a PostBack (using the update panel)
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我也遇到了同样的问题,并且很幸运地偶然发现了 UpdateProgress MSDN 上的控件概述。该页面上的示例显示了用于挂钩 ASP UpdatePanel 控件的异步 ajax 调用的秘密 javascript。经过一点修改,我就可以让 jQuery BlockUI 插件 正常工作使用 ASP UpdatePanel。
这就是我最终得到的结果。这里应该有足够的内容,以便您可以在异步回调开始和结束时做任何您想做的事情。
HTML
JAVASCRIPT
请注意,我包含了一个 ASP UpdateProgress 控件,这很重要,因为如果没有该控件,JavaScript 将无法正常工作。它会阻塞和解除阻塞 UI,但解除阻塞部分不会在回调返回时发生,它几乎在异步调用启动后立即发生。
I too was struggling with this same issue and was lucky enough to stumble across the UpdateProgress Control Overview on MSDN. An example on that page shows secret javascript for hooking into the async ajax calls of the ASP UpdatePanel control. With a little modification I was able to get the jQuery BlockUI plugin to work with an ASP UpdatePanel.
Here is what I ended up with. There should be enough here so that you could do anything you want when the async callback begins and when it ends.
HTML
JAVASCRIPT
Notice that I included an ASP UpdateProgress control, that is important because if you don't have that, the javascript doesn't work right. It will block and unblock the UI but the unblock part does not happen when the callback returns, it happens almost immediately after the async call is started.
对我来说,阻止控件本身
DropDownList
而不是整个 UI 就足够了,我所做的一切都不是使用jquery.blockUI()
插件,我只是添加了一行,它对我来说工作得很好这是我添加的内容:
@InitializationRequest
It was sufficient for me to block the control itself
DropDownList
instead of the entire UI and all I did instead of usingjquery.blockUI()
plugin I just added one line and it worked just fine for meHere is what I did add :
@ the InitializationRequest
可以使用ajax控制工具包的Update进度控制。当页面引用更新面板时,将显示下图,并且用户无法单击页面项目。
这里UpdatePanel3是你的更新面板的id。
您还可以添加ajaxcontrol工具包的AlwaysVisibleControlExtender。
这里cc1是ajax控制工具包dll的标签前缀。
You can use Update progress control of ajax control tool kit. when page refersh with update panel then below image will be show and user can not click on page items.
Here UpdatePanel3 is id of your update panel.
You can also add AlwaysVisibleControlExtender of ajaxcontrol tool kit.
Here cc1 is tag prefix of ajax control tool kit dll.