在MVC3会话控制器少 [英] Session less controller in MVC3

查看:116
本文介绍了在MVC3会话控制器少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说过在MVC3 sessionles控制器。

I have heard about sessionles controller in MVC3.

 [SessionState(SessionStateBehaviour.Disabled)] 
 public class   MyController :Controller   
 { 

 }

如果我用的是无会话控制器,那么如何我可以浏览翻过我的应用程序的页面为用户particuler?什么是最好的做法是什么?

If I use the sessionless controllers, then how I can browse accross the pages in my application for a particuler user? What is the best practice?

推荐答案

如果你想有一个用户在浏览多个页面的一个概念,一个标准的启用会话控制器的的最佳做法。

If you wish to have a concept of a single user browsing multiple pages, a standard Session-enabled controller is best practice.

与会话状态控制器为禁用不需要会话状态控制器提供的优化。

Controllers with session state disabled provide an optimization for controllers that do not require session state.

默认情况下,ASP.NET管道不会处理属于同一个会话并发请求。它串行化它们,即它会将他们的顺序,它们被接收,以便它们被处理串联而非并联

By default the ASP.NET pipeline will not process requests belonging to the same session concurrently. It serialises them, i.e. it queues them in the order that they were received so that they are processed serially rather than in parallel.

http://tech-journals.com/jonow/2011/10/22/the-downsides-of-asp-net-session-state

这篇关于在MVC3会话控制器少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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