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

refreshing an iframe from another iframe

Status
Not open for further replies.

ThatRickGuy

Programmer
Joined
Oct 12, 2001
Messages
3,841
Location
US
Hey guys, another one from the newbmister. I have a page with numerous iframes. I need to find a way to refresh one iframe from anothother.

The iFrame in question contains a page that holds all of the options for the data retreived in an iframe on it's parent. When the Options page hits postback, meaning the options have been changed, I want to refresh the iframe that contains the data.

Most of what I've been finding in searches has been for refreshing the parent of a pop-up window, not an iframe. Any pointers?

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Hi RTomes, I couldn't get that script to work, possibly since the document fireing the event was the page loaded in the iframe, which wouldn't have the desired frame in it's elements. But you did get me pointed in the right direction, here is the final solution I used:

Code:
  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'Put user code to initialize the page here
    If Not IsPostBack Then
      'Initial load stuff
    Else
      Dim strJavaScript As String
      strJavaScript = "<script language='javascript'>" & _
                      "self.parent.frames.item(2).location.href = ""DirectoryListing.aspx"";" & _
                      "</script>"
      Page.RegisterStartupScript("changeParentLocation", strJavaScript)
    End If
  End Sub

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top