ASP.NET窗体身份验证
我有以下ASP.NET表单身份验证配置:ASP.NET窗体身份验证,asp.net,forms-authentication,asp.net-4.0,Asp.net,Forms Authentication,Asp.net 4.0,我有以下ASP.NET表单身份验证配置: <system.web> <authentication mode="Forms"> <forms name="MembershipCookie" loginUrl="Login.aspx" protection="All" timeout="525600" slidingExpiration="true"
<system.web>
<authentication mode="Forms">
<forms name="MembershipCookie"
loginUrl="Login.aspx"
protection="All"
timeout="525600"
slidingExpiration="true"
enableCrossAppRedirects="true"
path="/">
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
<location path="Home.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location
如果用户正在访问Home.aspx,它将使用由
指定的Home.aspx的配置部分,因此如果用户正在访问Home.aspx,用户将不会被踢出登录.aspx。,它将使用由
指定的Home.aspx的配置部分,因此用户不会被踢出登录.aspx。如果用户访问Home.aspx,则将应用第二条规则,即
<location path="Home.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
这里要注意的一点是:*
告诉任何授权用户(有任何或没有分配角色)都可以访问该页面,但是?
告诉未授权用户无法访问该页面。如果用户访问Home.aspx,则将应用第二条规则,即
<location path="Home.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
这里需要注意的一点是:*
告诉任何授权用户(分配了任何角色或没有分配角色)都可以访问该页面,但是?
告诉未授权用户无法访问该页面。查看@JAngwenyi-感谢链接,我认为应该这样做。这个问题是一个理智的检查,请看我的最新帖子:check out@JAngwenyi-谢谢你的链接,我想这就是应该发生的事情。这个问题是一个精神检查,请参阅我的最新帖子: