代码很短:
前台:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OtherLogin.aspx.cs" Inherits="OtherLogin" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
      <script type="text/javascript">
       function GoUrl()
       {   
       
    document.forms['form1'].action= document.forms['form1'].elements['Url'].value;
        
    if( document.forms['form1'].elements['Url'].value==null)
    {
       window.location.href='default.aspx';
       window.close();
    }
    else
    {
         document.forms['form1'].submit();
    }
    
    if(document.forms['form1'].elements['NodeID'].value!="0")
    {
        document.forms['form1'].target="_blank";    
    }
    
       }
    </script>
    
    <title>无标题页</title>
    
</head>
<body onload="GoUrl()">
    <form id="form1"  method=post>
    <div>
    正在跳转
    </div>
       <input id="Url" name="Url" style="width: 2px; height: 1px" type="hidden" runat="server" />
       <input id="sUserNetName" style="width: 2px; height: 1px" name="sUserNetName" type="hidden"   runat="server" />
       <input id="hidpassword" style="width: 2px; height: 1px" runat="server" name="hidpassword"  type="hidden" />
       <input id="iUType" style="width: 2px; height: 1px" runat="server" name="iUType" type="hidden" />
       <input id="NodeID" style="width: 2px; height: 1px" runat="server" name="NodeID" type="hidden" />
    </form>
</body>
</html>后台:using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class OtherLogin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["Type"] != null && Request["U"] != null && Request["P"] != null)
            {
                if (Request["Type"].ToString() == "T")
                    RegTeacher();
                else
                    RegStudent();
            }
            else 
            {
                Response.Write("<script>alert('登录错误,请查询');window.location.href='default.aspx'</script>");//走到这个低昂来
            }        }
    }
    private void RegTeacher()
    {
       
        if (dt != null && dt.Rows.Count > 0)
        {
            this.Url.Value = "www.baidu.com";
        }
        else 
        {
            Response.Write("<script>alert('登录错误,请查询');window.location.href='default.aspx'</script>");
        }
    }
}
如果我的地址没有问题的话,跳转就没有没有问题,但是如果地址错误的话会反复跳转,进入到死循环了,请各路大神帮忙看下,我估计是提交的问题,html页面回传的问题,就是不知道如何处理!