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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting the parent href 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 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!

 
Your example is too skimpy to be sure I am on the right track. Let me take a stab at helping.

(NOTE: This forum deals mainly with actual javascript issues, not asp functionality relating to placement of scripts. the asp forum may be more skillful at this)

Nonetheless, you may be helped by referring to:


This link deals with some issues around the server-side asp function RegisterClientScriptBlock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top