主目录下的web.config下配置

 <authentication mode="Forms">
    <forms loginUrl="~/world_admin/world_admin.aspx" defaultUrl="~/world_admin/Defalut.aspx"></forms>
 </authentication>

//loginurl为默认的登陆页面

//defaulturl为登陆成功后跳转的页面

要配置登陆的文件夹中添加一个WEB。CONFIG,其代码如下

<?xml version="1.0"?>
<configuration>
 <system.web>
   <authorization>
     <deny users="?"/>
   </authorization>
 </system.web>
</configuration>


本文转载:CSDN博客