webressurs
asked on
ClientScript.RegisterClientScriptBlock -redirect dont works in firefox?
I have a frames based page, and need to make a redirect out of the frameset. I read that this could be done with javascript "top.location.href". It works fine in IE 7.0, but when testing it in Firefox it dont redirect at all (the browser has javascript enabled).
-------------------------- ---------- ---------- ---------- ----
This works in IE 7, but not in Firefox:
-------------------------- ---------- ---------- ---------- ----
string redirectUrl = "/view.aspx?id=" + Content.Id + "&newId=" + Content.Id;
Page.ClientScript.Register ClientScri ptBlock(Pa ge.GetType (), "Redirect", "top.location.href('" + redirectUrl + "');", true);
-------------------------- ---------- ---------- ---------- ----
I tried this also, but it only works in IE 7:
-------------------------- ---------- ---------- ---------- ----
string redirectUrl = "/view.aspx?id=" + Content.Id + "&newId=" + Content.Id;
Response.Write("<script language='javascript'>top. location.h ref('" + redirectUrl + "');</script>");
Why does it not work in Firefox?? Thanks :)
--------------------------
This works in IE 7, but not in Firefox:
--------------------------
string redirectUrl = "/view.aspx?id=" + Content.Id + "&newId=" + Content.Id;
Page.ClientScript.Register
--------------------------
I tried this also, but it only works in IE 7:
--------------------------
string redirectUrl = "/view.aspx?id=" + Content.Id + "&newId=" + Content.Id;
Response.Write("<script language='javascript'>top.
Why does it not work in Firefox?? Thanks :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
samtran0331, read the first sentence of the question.
Response.Redirect can only be used to do a redirect in the same frame.
Response.Redirect can only be used to do a redirect in the same frame.
ASKER
Hi! As GreenGhost say Response.Redirect can only be used to do a redirect in the same frame. Thats why I need to use a javascript fro doing this. Thank you GreenGhost , it worked perfect in IE and Firefox :)
ASKER
Just what I needed!
Response.Redirect("view.as
instead of RegisterClientScriptBlock