Frage

I have an MVC project that I am using simple membership with, and i have some actions marked with [Authorize].

When a user who is not logged in tries to view one of these actions, they are redirected to /Account/Login. How do I change that URL? I need it to go to /Account/Account/Login.

War es hilfreich?

Lösung

I believe Jasens answer is correct when using regular membership with ASP.NET, However I've discovered that with SimpleMembership it does not work.

To change it with SimpleMembership, the following record needs to be added in the web.config under <appSettings>

<add key="loginUrl" value="~/Your/Login/Url"/>

Andere Tipps

Specify the URL in web.config

<system.web>
    <authentication mode="Forms">
        <forms loginUrl="~/Account/Account/Login" timeout="2880" />
    </authentication>
</system.web>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top