如何保护Global.asax
中的网页以阻止http://yourapp/Login.aspx
之类的直接访问,以便您在通过该网页之前需要进行记录。
答案 0 :(得分:0)
答案 1 :(得分:0)
在web.config中,您可以为每个页面指定访问级别
<configuration>
<system.web>
<authentication mode="Forms"/>
<authorization> <deny users="?"/> //this will restrict anonymous user access
</authorization>
</system.web>
<location path="register.aspx"> //path here is path to your register.aspx page e.g. it could be ~/publicpages/register.aspx
<system.web>
<authorization>
<allow users="*"/> // this will allow access to everyone to register.aspx
</authorization>
</system.web>
</location>
</configuration>