Click here to Skip to main content
15,909,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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
C#
Page.ClientScript.RegisterStartupScript(Page.GetType(), "script", "window.location.href='Default3.aspx#3';", true); 
Posted
Comments
Pranav-BiTwiser 16-Mar-14 5:15am    
click on accept solution, if my code is working for you...

1 solution

try this.....

ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('your message');document.location.href='HTML5.aspx';", true);
 
Share this answer
 
Comments
[Reply from OP...]

Grateful but not working .
is Gridview rowcommand event problematic?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900