开发者

Where is the default authentication route configured in ASP.NET MVC?

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 succes开发者_如何学JAVAsfully 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


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜