我有一个需要保护的页面。我将[Authorize]
属性添加到该操作方法。如果您没有登录,每次访问该安全页面时,您都会被重定向到登录页面。
它可以工作,除了我将登录操作重命名为 login ,但 applicaiton 仍然将用户重定向到登录操作。它不再存在,我重命名它,我该如何解决?
我有一个需要保护的页面。我将[Authorize]
属性添加到该操作方法。如果您没有登录,每次访问该安全页面时,您都会被重定向到登录页面。
它可以工作,除了我将登录操作重命名为 login ,但 applicaiton 仍然将用户重定向到登录操作。它不再存在,我重命名它,我该如何解决?
In your Web.config file change the forms loginUrl.
<authentication mode="Forms">
<forms loginUrl="~/Controller/Action" />
</authentication>
You need to set the loginUrl
in the <forms />
element in Web.config.