只有经过验证的用户才能访问某个页面实现方法
在web.config文件中,设为forms身份验证:
<authentication mode= "Forms ">
<forms name= ".LoginUser " loginUrl= "admin/admin_login.aspx " protection= "All " timeout= "30 " />
</authentication>
<authorization>
<allow users= "* " />
</authorization>
然后在 </system.web> 后还要加入:
<location path= "admin ">
<system.web>
<authorization>
<deny users= "? " />
<allow users= "* " />
</authorization>
</system.web>
</location>