LoveToCode
MIS
- Jan 11, 2007
- 51
Hello,
I am trying to move the location of the entire browser from an iframe using ASP.NET. If I use Response.Redirect, I get just the iframe location redirected.
I think the answer is to use the RegisterClientScriptBlock() to add a javascript. This is the first time I've used this function, here is my code:
For some reason it does nothing. Does this javascript look ok? Do need to refresh the page, or add some additional code to call this script?
Thanks!
I am trying to move the location of the entire browser from an iframe using ASP.NET. If I use Response.Redirect, I get just the iframe location redirected.
I think the answer is to use the RegisterClientScriptBlock() to add a javascript. This is the first time I've used this function, here is my code:
Code:
string redirUrl = Core.Config.Root + "/profileArtist/?artistId=" + Request.QueryString["artistId"] + "&songId=" + Request.QueryString["artistId"];
string script = "parent.location.href='" + redirUrl + "'";
RegisterClientScriptBlock("redir", script);
For some reason it does nothing. Does this javascript look ok? Do need to refresh the page, or add some additional code to call this script?
Thanks!