FormsAuthentication LoginUrl [英] FormsAuthentication LoginUrl

查看:478
本文介绍了FormsAuthentication LoginUrl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里全盘损失。这是较早的工作。我使用窗体身份验证的应用程序MVC3。在Web配置,我有以下几点:

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

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

然而,出于某种原因,重定向时,或检查时FormsAuthentication.LoginUrl,它仍在使用缺省的/帐号/登录。它不存在。为什么心不是在web.config重写此?

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?

推荐答案

试着在你的将其加入的appSettings 的web.config

Try adding this to appSettings in your web.config:

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

这篇关于FormsAuthentication LoginUrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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