web.config
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings/>
<system.web>
<authorization>
<deny users="?"/>
</authorization>
<authentication mode="Forms" />
<compilation debug="true"/></system.web>
</configuration>
-----------------------------------------------
userlogged.aspx'登录成功后显示的页面
Partial Class userlogged
    Inherits System.Web.UI.Page    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load        Label1.Text = Request.Cookies("username").Value
    End Sub
End Class
-----------------------------
userlogin.aspx  '登录界面
Imports System.Web.Security.FormsAuthentication
Partial Class userlogin
    Inherits System.Web.UI.Page    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        System.Web.Security.FormsAuthentication.RedirectFromLoginPage("xubin", False)
    End SubEnd Class
-------------------------------当我登录后,页面一直会跳回到userlogin.aspx上,高手指教

解决方案 »

  1.   

    <authentication mode="Forms">

    <forms name=".DDD" loginUrl="userlogin.aspx" timeout="20" slidingExpiration="true" cookieless="UseDeviceProfile" protection="All" requireSSL="false" enableCrossAppRedirects="false" defaultUrl="xxxx.aspx" path="/"/>
      

  2.   

    楼上的,我试过了,还是一样!输出里面都是这些东西
    “System.Threading.ThreadAbortException”类型的异常在 mscorlib.dll 中发生,但未在用户代码中进行处理
    在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常
    “System.Threading.ThreadAbortException”类型的异常在 mscorlib.dll 中发生,但未在用户代码中进行处理
    在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常
    “System.Threading.ThreadAbortException”类型的异常在 mscorlib.dll 中发生,但未在用户代码中进行处理
    在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常
    “System.Threading.ThreadAbortException”类型的异常在 mscorlib.dll 中发生,但未在用户代码中进行处理
      

  3.   

    web.config中的跳转应该只是对应于登录来说的。如果是自己写的逻辑,要编码来进行跳转。                // 直接生成身份验证票并跳转页面
                    //FormsAuthentication.RedirectFromLoginPage(username, true);                // 获得用户的角色列表
                    string roles = PERoles.GetRolesByUser(userInfo.UserId);                //// 创建身份验证票
                    FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(
                        1, userInfo.UserName, DateTime.Now, DateTime.Now.AddMinutes(20), false, roles);                // 创建身份验证票的加密字符串
                    string encryptedTicket = FormsAuthentication.Encrypt(authTicket);                // 将加密字符串存储在 HttpCookie 对象中
                    HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);                // 将此 cookie 添加到返回给用户浏览器的 cookie 集合中
                    Response.Cookies.Add(authCookie);                // 将用户重定向到最初请求的页
                    Response.Redirect(FormsAuthentication.GetRedirectUrl(userInfo.UserName, false));
      

  4.   

    如果想减少编码工作量,你可以用asp.net2.0的membership和相关登录控件。
    当然,如果是asp.net1.1那就只有自己编写登录代码了。
      

  5.   

    晕倒了,同样的程序在xp+iis5.1下就可以用,可移植到win2003+iis6.0下就不能用了!郁闷