0

I've got an old WebForms-based ASP.NET app that I have upgraded to ASP.NET 4.0 and I want to add some portions of the site that use MVC. I've successfully done this but the problem is I want to share the old login page.

I used the instructions here to integrate MVC.

Both parts of the site use the SqlMemberbershipProvider, but even though my web.config is configured to route unauthenticated requests to my "~/Login.aspx" page, they are now getting kicked to "Accounts/Login".

Here's my web config auth entry:

<authentication mode="Forms">
  <forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" />
</authentication>

Where in the MVC plumbing does it now override that to force it to "Accounts/Login". is this just a "convention" used by MVC? The upshot is I still want to redirect unauthenticated requests to Login.aspx no matter what the target page/route is.

Mike

1 Answer 1

2

That's a known bug. You may try adding the loginUrl app key following to your web.config:

<appSettings>
    <add key="loginUrl" value="~/login.aspx" />
<appSettings>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the link. I was knee deep System.Web.Mvc in Reflector when I decided to take a break and post to SO. Saved me another few hours probably.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.