FormsAuthentication自动重定向到其他URL比在web.config中指定? [英] Automatic redirection of FormsAuthentication to other URL than specified in the Web.Config?

查看:419
本文介绍了FormsAuthentication自动重定向到其他URL比在web.config中指定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Web.config本节我MVC3应用程序:

I have this section in the Web.config for my MVC3 application:

<authentication mode="Forms">
  <forms loginUrl="~/Account/LogOn" timeout="20" slidingExpiration="true"/>
</authentication>

直到最近每次code创下 [授权] 属性的LogOn.cshtml页面被证明。突然重定向的发生账户/登录(的'O'的不是我,而不是!),我得到一个资源未发现异常。我做了查找的Web.config,找不到的话'登录'的任何地方!在Earh有什么可以在哪里呢?

Until recently every time the code hit an [Authorize] attribute the LogOn.cshtml page was shown. All of a sudden the redirection takes place to Account/Login (not the 'i' instead of the 'O'!!!) and I get a resource not found exception. I did a Find on the Web.config and could not find the word 'login' anywhere! What on Earh can have gone wrong?

推荐答案

这是一个的已知问题作为发行说明说明。为了解决这个问题只需添加以下到&LT;&的appSettings GT; 你的web.config的节点:

This is a known issue with ASP.NET MVC 3 as stated in the release notes. To solve it simply add the following to the <appSettings> node of your web.config:

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

或以下主要试图通过发行票据的建议:

or try with the following key as suggested by the release notes:

<add key="autoFormsAuthentication" value="false" />

这篇关于FormsAuthentication自动重定向到其他URL比在web.config中指定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆