显示阿贾克斯装载机,而页面呈现装载机、页面、阿贾克斯

2023-09-11 01:28:53 作者:啪啪啪

这可能是一个简单的问题,但我怎样才能最好地使用AJAX装载机在ASP​​.NET中提供了装载对话框,而该页面正在建设?

This is probably a simple question but how can I best use an AJAX loader in ASP.NET to provide a loading dialog whilst the page is being built?

目前,我有一个关联的UpdateProgressPanel其中包含了ProgressTemplate加载消息和GIF一个UpdatePanel。

I currently have an UpdatePanel with an associated UpdateProgressPanel which contains the loading message and gif in a ProgressTemplate.

目前我有一个页面,该页面的onLoad()去,并得到业务实体,然后显示出来。虽然是这样做的,我想展示一个AJAX加载器。

Currently I have a page that onLoad() goes and gets the business entities and then displays them. While it is doing this I would like to display an AJAX loader.

这将是最好有没有在页面加载,并有一个隐藏的按钮被触发的onLoadComplete或卸载(),这将然后等待按钮点击的方法来完成显示UpdateProgressPanel?

Would it be better to have nothing in the page load and have a hidden button that is triggered onLoadComplete or unLoad() which would then wait for the button click method to complete displaying the UpdateProgressPanel?

推荐答案

我已经做了一个Timer控件类似的东西。你的OnLoad刚打开计时器,并在页面完成渲染。然后定时器(有一些最小间隔值)做肮脏的工作,表现出正常的进度面板。记得关闭计时器的过程的最后步骤。

I've done something similar with a Timer control. Your OnLoad just turns on the timer, and the page finishes rendering. Then the timer (with some minimal interval value) does the dirty work, showing the progress panel correctly. Remember to turn off the timer as the last step of the process.