用FormsAuthentication.RedirectFromLoginPage()方法。

解决方案 »

  1.   

    Web.config 中设置应用程序的身份验证策略。。<authentication mode="Forms">
    <forms name="UserAuth" loginUrl="login.aspx" protection="All" timeout="60" />
    </authentication>
    <authorization>
    <deny users="?" />
    </authorization>
      

  2.   

    1、如果要定向的页面比较少,可在login.aspx中先经FormsAuthentication.RedirectFromLoginPage(“”, true);判断后用
    case判断指向不同的页面。
    2、将用户名、口令、指向页面放在数据库中,在login.aspx中经FormsAuthentication.RedirectFromLoginPage(“”, true)判断后指向相应的页面。
      

  3.   

    对了要在web.config中加入定向页面的登录验证,如:
        <location path="manageinfo.aspx">
            <system.web>
                <authorization>
                    <deny users="?" />
                </authorization>
            </system.web>
        </location>