先做一个登录验证的页面.假设叫login.aspx,在webconfig中加入:
<authentication mode="Forms">
      <forms name=".ADUAUTH" loginUrl="/login.aspx" protection="All">
      </forms>
  </authentication>
  <authorization>
      <deny users="?"/> 
      <allow users="*"/>
  </authorization>
页面login.aspx验证通过后,返回一个true值.如果未通过该页面验证,会自动转入该页面

解决方案 »

  1.   

    下面是我们项目中采用的方法,其中personsystem为项目名称 <!--  AUTHENTICATION 
              This section sets the authentication policies of the application. Possible modes are "Windows", "Forms", 
              "Passport" and "None"
        -->
        <authentication mode="Forms" >
     <forms name="personsystem" path="/" loginUrl="login.aspx" protection="All" timeout= "1"></forms> 
     <!--<credentials passwordFormat="SHA1"><user name="lqj" password="pwd"/></credentials>-->
        </authentication> 
        <authorization>
            <deny users="?" />
          </authorization>