ASP.net网站:用户长期加载页面将所有其他页面加载用户持机 [英] ASP.net site: Long-loading page for user puts all other page loads for user on Hold

查看:183
本文介绍了ASP.net网站:用户长期加载页面将所有其他页面加载用户持机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下情形(Asp.net 3.5和Windows Server 2008 R2,IIS7):

I have the following scenario (Asp.net 3.5, Windows Server 2008 R2, IIS7):


  • 用户1登录到abc.com使用Firefox,并进入一个页面,需要几分钟来加载。

  • 虽然该页面正在加载,用户1无法加载网站上的任何其他网页。

  • 现场为用户1使用这个浏览器上的所有其他的页面请求没有收到,直到第一个页面要么加载完成或超时(然后其他请求被快速连续完成)的响应。

  • 当第一页仍在加载(以及其他请求被搁置),如果我打开一个不同的浏览器(Chrome,但也很容易被IE),并登录到具有相同的用户的网站,我没有问题加载页面。

如此看来,一个单独的用户会话只能够在同一时间(因为在不同的浏览器相同的登录用户确实是一个不同的会话ASP.net)来处理一个请求。

So it seems that the one individual user session is only able to handle a single request at a time (since the same user logging in with a different browser is really a different session to ASP.net).

我想发生的是,而对于用户1长加载请求加载,用户1是能够加载网站上的其他页面(在同一浏览器)。

What I would like to happen is that while the long-loading request for User1 is loading, that User1 is able to load other pages on the site (in the same browser).

监控服务器,不存在内存问题(没有用于SQL Server其一)。而我使用该网站的唯一的人,我这样做。网站是ASP.net 3.5,使用窗体身份验证。只有非标准设置的细节是,ViewState是存储在会话。

Monitoring the server, there are no memory issues (none for Sql Server either). I am doing this while I am the only person using the site. Site is ASP.net 3.5, using Forms authentication. Only non-standard setup detail is that ViewState is being stored in Session.

在我的搜索,到目前为止,我一直没能找到有关的事。如果这是预期的行为,我怎么可以重写呢?如果这不是预期的行为,这可能是导致它,我怎么能解决这个问题?

In my searching so far, I have not been able to find anything relating to this. If this is the expected behavior, how can I override it? If this is not the expected behavior, what could be causing it, and how can I fix it?

推荐答案

这行为是设计;到会话状态,不会并发访问是允许的。与相同的SessionID请求将被完全锁定其状态的prevent潜在破坏。

This behaviour is by design; no concurrent access to the session state is allowed. Requests with same SessionID will be locked exclusively to prevent potential corruption of its state.

要解决这个问题,你可以在你的page指令禁用会话状态。

To get around this you can disable session state in your page directive.

<%@Page EnableSessionState="false"/>

阅读并发请求和会话状态在这里 http://msdn.microsoft .COM / EN-US /库/ ms178581.aspx 了解。

设置的EnableSessionState =只读将prevent该网页上SessionState会获得独占锁(但网页本身将不得不等待其他非用户只读请求加载之前完成)。

Setting EnableSessionState="ReadOnly" will prevent that page from gaining an exclusive lock on the SessionState (but the page itself would have to wait for other non-ReadOnly requests by the user to finish before loading).

这篇关于ASP.net网站:用户长期加载页面将所有其他页面加载用户持机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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