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

Frames and Response.Redirect

Status
Not open for further replies.

12thMan

Programmer
Jan 6, 2007
2
0
0
US
How do i redirect the entire parent frame from an iframe using Response.Redirect. Currently when I call this from the frame it redirects just the containing frame.

-- shawn
 
you cannot do with response.redirect...you need to use javascript...

-DNG
 
Ok thanks. So the best way is to do

Code:
 Response.Write("<script>parent.location.href=('MyUrl.URI')</script>");

??

-- shawn
 
something like this:
Code:
  Dim url As String = "your URL"
  Response.Write("<script>" & vbCrLf)
  Response.Write("top.location.replace('" & url & "');" & vbCrLf)
  Response.Write("</script>")

-DNG
 
You shouldn't use Response.Write to write out any javascript to the Page as this is very bad practice and will almost certainly cause your page to fail validation. Instead, use the RegisterStartUpScript or RegisterClientScriptBlock methods or write it out to a Literal control.


____________________________________________________________

Need help finding an answer?

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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top