简体   繁体   English

使用ASP.NET Ajax放置一段时间后页面会挂起

[英]Page hangs when leaving it for a while using ASP.NET Ajax

I'm working on a business application using ASP.NET Ajax , NHibernate and Spring.Net, I've got an annoying problem. 我正在使用ASP.NET Ajax,NHibernate和Spring.Net开发业务应用程序,但我遇到了一个烦人的问题。 The problem is that when I leave page for about 5 minutes and then return back and try to make any action that posts back, it displays wrongly (if there are controls hidden by style it became visible). 问题是,当我离开页面约5分钟,然后返回并尝试执行任何回发的操作时,它显示错误(如果样式隐藏了控件,则该控件可见)。 In addition, the page didn't post back to the server. 此外,该页面未发回到服务器。

Also the problem happens when opening two different tabs, different pages (Each page uses session but different keys ) 当打开两个不同的选项卡(不同的页面)时,也会发生此问题(每个页面使用会话,但使用不同的键)

Thanks in advance 提前致谢

As you describe the problem, its sounds that connect the content of the page with the user cookie and session, and when the session expired the application did not take care to recreate it. 当您描述问题时,它的声音将页面的内容与用户cookie和会话连接起来,并且当会话过期时,应用程序不会注意重新创建它。

So the post back fail because the session data have been lost when the page ask for them / need them to work and display correct the results. 因此回发失败是因为在页面要求/需要它们工作并显示正确的结果时会话数据已经丢失。

This is the issue that I diagnose, how you fix that is up to you :) 这是我诊断出的问题,如何解决取决于您:)

Possible solutions 可能的解决方案

  1. Change the logic of the page creation. 更改页面创建的逻辑。
  2. While the user is on page do not let the session ends (not good practice) 当用户在页面上时,请勿让会话结束(这不是很好的做法)
  3. Store the user data of the page, on a database - connected with the user, and delete it after some days if not have been updated. 将页面的用户数据存储在与用户连接的数据库上,并在几天后将其删除(如果尚未更新)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM