response.redirect不在chrom中工作 [英] response.redirect not working in chrom

查看:155
本文介绍了response.redirect不在chrom中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题。我很感激回答。



i有一个Gridview,其中一列包含一个按钮(在itemtemplate内)。



i在Gridview rowcommand事件中写了一个程序,用于将response.redirect用于自己的页面。但是这个response.redirect没有在chrome或firefox上工作。但正确使用IE浏览器。



我的代码是:

i have a problem .i'm grateful to answer.

i have a Gridview that included a button at one its column (inside itemtemplate).

i wrote a program inside Gridview rowcommand event for button that used response.redirect to self page. but this response.redirect not working at chrome or firefox. but working in IE correctly.

my code is:

public void G2_RowCommand(object sender, GridViewCommandEventArgs e)// in GridView,each button that be clicked,call this Gridview event 
{
    if (e.CommandName == "edit")//if this condition was true , 
    {
        Session.Remove("type");
        Session.Add("taskReport_id",e.CommandArgument.ToString());
        Response.Redirect("Default3.aspx#3");
      }  
    }



我在下面试过但这也不起作用


I tried below but this not working also

Page.ClientScript.RegisterStartupScript(Page.GetType(), "script", "window.location.href='Default3.aspx#3';", true); 

推荐答案

试试这个.....



try this.....

ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('your message');document.location.href='HTML5.aspx';", true);


这篇关于response.redirect不在chrom中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆