【发布时间】:2012-02-21 18:43:37
【问题描述】:
如果未设置 cookie,我想将我的 web.config 文件设置为重定向到 login.cshtml。我怎样才能做到这一点?我现在也表现出一些我不理解的行为。我有:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<authentication mode="Forms">
<forms loginUrl="Login.cshtml" name=".ASPXFORMSAUTH">
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
正在发生的事情是用户被重定向到
"Account/Login ReturnUrl=%2fdefault.cshtml"
所以 default.cshtml 正在呈现,其中有一个奇怪的登录页面集中放置在其中?这可能与我的程序结构有关,但我真的不明白什么叫可以呈现这个奇怪的 HTML?
【问题讨论】:
标签: c# asp.net html web-config authorization