开发者

FormsAuthentication LoginUrl [duplicate]

开发者 https://www.devze.com 2023-03-14 15:40 出处:网络
This question already has answers here: MVC Forms LoginUrl is incorrect (8 answers) Closed 6 years ago. I am at a total loss here. This was working earlier. I have an MVC3 app using forms a
This question already has answers here: MVC Forms LoginUrl is incorrect (8 answers) Closed 6 years ago.

I am at a total loss here. This was working earlier. I have an MVC3 app using forms authentication. In开发者_JAVA百科 web config, I have the following:

<authentication mode="Forms">
  <forms loginUrl="~/Login/Index" timeout="2880"/>
</authentication>

Yet, for some reason, when redirecting, or when checking FormsAuthentication.LoginUrl, its still using the default /Account/Login. Which doesn't exists. Why isnt the web.config overriding this?


Try adding this to appSettings in your web.config:

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


I have also had these issues and it only happened when i had added deployable assemblies and webmatrix.dll was added. That is when it started to try to redirect to an Account Controller which was not specified anywhere in my project.

Once i removed webmatrix.dll everything worked as intended.

0

精彩评论

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