Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the PreserveLoginUrl appSetting key/value in an ASP.NET MVC application?

I was reviewing some ASP.NET MVC code, specifically a web.config file.

I noticed this in the appSettings section:

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

  1. What does this do?
  2. When was it introduced to ASP.NET MVC?

cheers!

like image 667
Pure.Krome Avatar asked Nov 10 '12 11:11

Pure.Krome


People also ask

What is the configuration file for ASP NET MVC core app?

ASP.NET MVC configuration In ASP.NET apps, configuration uses the built-in . NET configuration files, web. config in the app folder and machine. config on the server.

Does MVC use web config?

In MVC project you will find two web. config files - One in root path and another in Views folder. Let's see one by one about these files with its uses in MVC application.

What is form in MVC?

ASP.NET MVC Form is the most important and essential thing that most programmers learn. ASP.NET MVC Form is one of the components in the MVC Framework which is suggested to work with Forms. MVC is divided into three ways which focused on the separation of concerns.


1 Answers

From the 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

like image 181
CodeCaster Avatar answered Sep 20 '22 02:09

CodeCaster