网址上的Mvc应用会话问题发生了变化 [英] Mvc app session problem on url change
本文介绍了网址上的Mvc应用会话问题发生了变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要更改MVC项目的url。在部分视图中运行的代码在会话中存储用户数据。
当我将IIS Express URL从http:// localhost:65000 /更改为http:// localhost:65000 / test时,看到会话变量的其他部分视图将其视为null。如果我更改了网址,它再次正常工作。
我想我错过了一些明显的东西。
谢谢
我尝试了什么:
将web.config会话设置更改为无效
I need to change the url for an MVC project. Code running in partial views stores user data in the session.
When I change the IIS Express url from http://localhost:65000/ to http://localhost:65000/test, other partial views which saw the session variable see it as null. If I change the url back, it works fine again.
I assume I'm missing something obvious.
Thanks
What I have tried:
Changed web.config session settings to no effect
推荐答案
您好,您需要在RouteConfig.cs中设置起始页面。它位于App_Data中。
在您的URL中缺少控制器名称。
Hi, You Need to set starting page in RouteConfig.cs. It is located in App_Data.
In your URL Missing Controller Name.
这篇关于网址上的Mvc应用会话问题发生了变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文