我有一个用ASP .NET MVC编写的应用程序。问题是请求应该异步运行,但实际上却是同步运行。临时修复程序,用于在每个控制器上将会话状态设置为只读,如下面的代码所示。我想要做的是在Global.asax
中以某种方式执行此操作,因此不必在整个应用程序中都重复此操作。见下文:
<pre>namespace PricingApp.Controllers
{
[UserContextFilter]
[ProposalContextFilter]
[SharePointContextFilter]
[AjaxSharePointContextFilter]
[RequiresPermission(PermissionCodes.ViewLOE)]
// TODO: Remove once SessionState/request queuing issue is resolved
[SessionState(System.Web.SessionState.SessionStateBehavior.ReadOnly)]
public class LOEController : Controller
</pre>