【问题标题】:How to enable session only in specific view and disable it on others in ASP.NET MVC如何仅在特定视图中启用会话并在 ASP.NET MVC 中的其他视图中禁用它
【发布时间】:2009-10-09 09:41:24
【问题描述】:

我只需要在我的 MVC 项目中的几个视图上使用会话。这些视图对网络爬虫是不可见的。 我使用 cookieless="AutoDetect" 所以网络爬虫(以及禁用 cookie 的用户)即使在不需要会话的页面上也会从 IIS(即“(S(hkec1uq1onbt0xafixedjc45))/en/home.mvc”) 获取丑陋的 url。

有什么方法可以只在特定页面上启用会话并在其他页面上禁用?

谢谢。

【问题讨论】:

    标签: asp.net session


    【解决方案1】:

    对于 ASP.NET MVC,禁用会话并不是“开箱即用”的首选。我认为this post 会让你走上正确的道路。

    【讨论】:

      猜你喜欢
      • 2015-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-03
      • 2010-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多