我正在审查一些ASP.NET MVC
代码,特别是 web.config 文件。
我在 appSettings
中注意到了这一点部分:
<add key="PreserveLoginUrl" value="true" />
- 这是做什么的?
- ASP.NET MVC 何时引入?
干杯!
最佳答案
来自MVC 4 Whitepaper :
When WebMatrix.WebData.dll is included in in the /bin directory of an ASP.NET MVC 4 apps, it takes over the URL for forms authentication. Adding the WebMatrix.WebData.dll assembly to your application (for example, by selecting "ASP.NET Web Pages with Razor Syntax" when using the Add Deployable Dependencies dialog) will override the authentication login redirect to /account/logon rather than /account/login as expected by the default ASP.NET MVC Account Controller. To prevent this behavior and use the URL specified already in the authentication section of web.config, you can add an appSetting called PreserveLoginUrl and set it to true
关于.net - ASP.NET MVC 应用程序中的 PreserveLoginUrl appSetting 键/值是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13321843/