ASP.NET在长时间回发期间进行AJAX调用 [英] ASP.NET making AJAX calls during long Postback

查看:66
本文介绍了ASP.NET在长时间回发期间进行AJAX调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网页中有一个简单的要求.

I have a simple requirement in a Web Page.

页面上有一个按钮,导致服务器上的回发和冗长的过程,因此回发等待服务器方法完成并花费很长时间.例如,没有使用Threadpool将服务器操作异步排队的选项.这主要是因为在服务器上,需要使用ReportViewer控件呈现多个报表,而这些报表无法在新线程中执行.

I have a button on the page which causes a postback and a lengthy process on server.So the post back waits for the server method to finish and takes a long time. There is no option to queue the server action asynchronous using Threadpool for example. This is mainly because at the server what is needed is to render several reports using the ReportViewer control which cannot be performed in a new thread.

因此,一种折衷的解决方案是在客户端显示进度表.我尝试通过对服务器的Ajax调用来确定作业进度,但是可能是由于我们处于回发模式下,所以Ajax调用不起作用.

So a compromise solution is to display a progress meter at client.I tried this using Ajax calls to server to determine job progress , but probably due to the fact we are in post back mode the Ajax call does not work.

将感谢您的帮助谢谢

推荐答案

因此,您可以将主要帖子重新制作为ajax帖子,以便您可以在等待重播时执行某些操作.

So can you make the main post back to an ajax post so that you can do something while waiting for the replay.

这篇关于ASP.NET在长时间回发期间进行AJAX调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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