首页 新闻 赞助 找找看

登录无法跳转

0
悬赏园豆:50 [已关闭问题] 关闭于 2009-08-07 18:07

我的登录中有一段跳转代码

用1级用户名跳转到页面a

用2级用户名跳转到页面b

我的跳转页面中有一段脚本

<script type="text/javascript">
var a=10;
function aa(url)
{ var b;
  td1.innerHTML ="";
  a--;
  b=setTimeout("aa('"+url+"')",200);
  if(a==-1)
 { clearTimeout(b);
  window.location=url;
 }
 
 }
 </script>

我的页面中写的是:

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class tiaozhuan : System.Web.UI.Page
{
    protected ruixiang rx = new ruixiang();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
           Bind();
        }
    }
    /// <summary>
    /// 设置页面跳转
    /// </summary>
    protected void Bind()
    {
        if (Request.Cookies["huiyuan"] != null)
        {
            string ziduan = "huiyuan_name";
            string biao = "jj_huiyuan";
            string where = "huiyuan_jincheng = 0 and huiyuan_user_name ='" + Request.Cookies["huiyuan"]["huiyuan_name"].ToString()+"'";

            Hashtable dr = rx.GetReader(ziduan, biao, where);
            if (dr != null)//一级用户名
            {
                img1.Visible = true;
                Page.RegisterStartupScript("ggg", "<script>aa('../chanpin/cplei_list.aspx');</script>");

            }
            else//二级用户名
            {
                img2.Visible = true;
                Page.RegisterStartupScript("ggg", "<script>aa('../new_lipin/lipin_index.aspx');</script>");
            }
        }
        else
        {
            Response.Write("<script>window.location('../index.aspx');</script>");
        }
    }
}

可是我在火狐浏览器中一直停留在跳转页面跳转不过去

请问是什么问题呢

是我的脚本写的有问题吗

请教高手????

追太阳的向日葵的主页 追太阳的向日葵 | 初学一级 | 园豆:29
提问于:2009-08-06 09:58
< >
分享
所有回答(4)
0

你在IE中试过吗?javascript在ie和firefox中的解释不同。

Gnie | 园豆:468 (菜鸟二级) | 2009-08-06 10:02
当然试过 没试过 就不会说在火狐不能用 就该说我代码本身问题了 我就是想知道是不是脚本不兼容问题 谢谢
支持(0) 反对(0) 追太阳的向日葵 | 园豆:29 (初学一级) | 2009-08-06 10:07
0

没的救了

New.min | 园豆:313 (菜鸟二级) | 2009-08-06 10:22
没的救是什么意思 明白点
支持(0) 反对(0) 追太阳的向日葵 | 园豆:29 (初学一级) | 2009-08-06 10:23
0

你直接在后台判断再用下面的方法跳转不就得了

Response.Write("<script>window.location.href='~/Default6.aspx';</script>");

江峰 | 园豆:178 (初学一级) | 2009-08-06 13:10
谢谢 不没看明白我的意思 谢谢
支持(0) 反对(0) 追太阳的向日葵 | 园豆:29 (初学一级) | 2009-08-06 13:37
0

不明白

if (dr != null)//一级用户名
            {
                img1.Visible = true;
                //Page.RegisterStartupScript("ggg", "<script>aa('../chanpin/cplei_list.aspx');</script>");

这里直接判断跳转不就可以了?为什么要用javascript呢?如果你用的img是html控件,你就在这个控件的代码模式加上runat="server",后台代码不就可以直接判断了吗?

            }
            else//二级用户名
            {
                img2.Visible = true;
                Page.RegisterStartupScript("ggg", "<script>aa('../new_lipin/lipin_index.aspx');</script>");
            }

风浪 | 园豆:2996 (老鸟四级) | 2009-08-06 16:11
我要的是延迟跳转的效果 你没看懂我JS的意思
支持(0) 反对(0) 追太阳的向日葵 | 园豆:29 (初学一级) | 2009-08-07 18:06
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册