1

我有一个需要保护的页面。我将[Authorize]属性添加到该操作方法。如果您没有登录,每次访问该安全页面时,您都会被重定向到登录页面。

它可以工作,除了我将登录操作重命名为 login ,但 applicaiton 仍然将用户重定向到登录操作。它不再存在,我重命名它,我该如何解决?

4

2 回答 2

4

In your Web.config file change the forms loginUrl.

<authentication mode="Forms">
  <forms loginUrl="~/Controller/Action" />
</authentication>
于 2012-01-05T23:38:54.860 回答
0

You need to set the loginUrl in the <forms /> element in Web.config.

于 2012-01-05T23:38:21.130 回答