login redirect changed after using microsoft.web.helpers

前端 未结 3 1394
鱼传尺愫
鱼传尺愫 2021-01-05 09:59

In an asp.net mvc3 website, I imported the microsoft.web.helpers, webmatrix.data, and webmatrix.webdata. After that, I have found that when I use the [Authorize] attribute

相关标签:
3条回答
  • 2021-01-05 10:14

    you can just delete WebMatrix.WebData.dll from you bin file

    0 讨论(0)
  • 2021-01-05 10:19

    I ran into that same issue some time ago. I had added a 'deployable dependency' on 'ASP.NET Web Pages with Razor Syntax'. This adds a reference to: WebMatrix.Data.dll This assembly has a class with a static constructor that does the following:

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

    That explains! It will override whatever you had in your web.config.

    0 讨论(0)
  • 2021-01-05 10:34

    To override use:

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

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

    0 讨论(0)
提交回复
热议问题