.net - ASP.NET MVC 应用程序中的 PreserveLoginUrl appSetting 键/值是什么?

标签 .net asp.net-mvc

我正在审查一些ASP.NET MVC代码,特别是 web.config 文件。

我在 appSettings 中注意到了这一点部分:

<add key="PreserveLoginUrl" value="true" />

  1. 这是做什么的?
  2. 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/

相关文章:

C# 映射两个复杂对象

c# - 如何链接列表中的方法,以便一个方法的结果成为下一个方法的输入?

asp.net-mvc - HttpContext.RequestAborted 和 CancellationToken 参数有什么区别?

c# - 如何初始化 IOption<AppSettings> 以对 .NET 核心 MVC 服务进行单元测试?

c# - 在 C# 中计算中位数

.net - SQL Server CE 和 Visual Studio 2013

c# - 我们可以在 C#.NET winform 中创建 4 个象限的 3D 图形吗?

.net - 在新项目中学习 MVC,还是坚持使用 WebForms?

c# - 我应该在每个 POST 请求中使用 ValidateAntiForgeryToken 吗?

asp.net-mvc - 隐藏 Razor 输入上的 ng-model 不起作用