Name forwarding changed after using microsoft.web.helpers

On the asp.net mvc3 website, I imported the microsoft.web.helpers, webmatrix.data and webmatrix.webdata files. After that, I found that when I use the [Authorize] attribute for some ActionResults in controllers, my redirection points to the \ login account and not the \ logon account, as it was before, and is the default value.

I do not use WebMatrix, but I want to use the microsoft.web.helpers function. I searched the code for any link to the \ login account, but I could not find it. My web configuration for authentication is shown below:

<authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> 
+7
source share
3 answers

To override usage:

 <configuration> <appSettings> <add key="loginUrl" value="~/Account/Logon" /> </appSettings> </configuration> 

From http://www.redmountainsw.com/wordpress/archives/webmatrix-redirects-unauthorized-pages-to-accountlogin

+8
source

I came across the same question a while ago. I added "deployable dependency" to "ASP.NET Web Pages with Razor Syntax". This adds a link to: WebMatrix.Data.dll. This assembly has a class with a static constructor that performs the following actions:

 static FormsAuthenticationSettings() { FormsAuthenticationSettings.LoginUrlKey = "loginUrl"; FormsAuthenticationSettings.DefaultLoginUrl = "~/Account/Login"; } 

That explains! It will undo everything that you had in your web.config.

+3
source

you can simply remove WebMatrix.WebData.dll from your bin file

+2
source

All Articles