ASP.Net - 等到所有页面方法都没有完成。 [英] ASP.Net - Wait until all Page Methods are not completed.

查看:64
本文介绍了ASP.Net - 等到所有页面方法都没有完成。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个ASP.NET应用程序,并且有一个页面,其中所有服务器端处理都使用页面方法(页面上提供了脚本管理器)。

现在的问题是服务器上有多个异步处理,有些需要1~20秒,但其中一个需要30分钟左右。有些是在其他人成功的情况下执行的。

会话超时(20分钟)和执行超时(60分钟)并按预期工作。



我还有一个java脚本函数,用于检查用户的空闲时间,如果用户在20分钟之前没有采取任何操作,则会出现一条警告消息,即使一个异步请求仍在后面运行,用户也会自动注销。



有没有办法检查是否有任何异步请求仍在运行?如果是,那么我将检查我检查空闲时间的java脚本代码。

Hi,
I have an ASP.NET application and have one page in which all the server side processing are using Page Methods (Script Manager is available on page).
Now the issue is that there are multiple asynchronously processed on server some are taking 1~20 seconds but one of them takes 30 minutes approx. Some are executed on success of other one.
Session timeout (20 min) and execution timeout (60 min) and working as expecting.

I have also a java-script function who checks the idle time on user and if user not taken any action until 20 min then a warning message appears and user will automatically logged out even one asynchronous request is still running behind.

Is there any way to check if any asynchronous request is still running? If yes then i will check on my java-script code who checks the idle time.

推荐答案

我能想到的唯一方法就是您的JavaScript设置了一个全局变量,您可以检查它是否已完成。问题是用户可以浏览到不同的页面,您的进程将永远不会返回JS重置变量。



您可以调用Web服务来检查会话设置但问题是你每次联系服务器时都会重置会话超时,这可能是你不想做的事情。



听起来你应该大大增加会话超时以解决这些过程。
The only way to do this, that I can think of, is in your JavaScript set a global variable that you can check to see if it has finished or not. The problem is the user could browse to a different page and your process will never return back to JS to reset the variable.

You could call a webservice to check session settings but then the problem is you'll reset your session timeout every time you contact the server which is probably what you don't want to do.

It sounds like you should really increase the session timeout dramatically to account for these processes.


这篇关于ASP.Net - 等到所有页面方法都没有完成。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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