Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting parent frame from an iFrame

Status
Not open for further replies.
Jan 11, 2007
51
Hello,

I am trying to move the location of the entire browser from an iframe. If I use Response.Redirect, I get just the iframe location.

I think the answer is to use the RegisterClientScriptBlock() to add a javascript. This is the first time I've used this fucntion, 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. I do need to refresah the page, or add some additional code to call this script?

Thanks!
 
Maybe the javascript forum will be able to help you out to make sure the javascript you have registered is correct. Try pasting the final markup that is sent to the client into a question in that forum .


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thank you. I am moving this question to the Javascript Forum.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top