Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 22nd, 2003, 11:13 AM
Registered User
 
Join Date: Sep 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accessing page object within an IFRAME

I have an ASP.NET app with an IFRAME embedded in the main page. I display different content within the IFRAME. How can I programmatically access the page object currently loaded in the IFRAME from the main page?


  #2 (permalink)  
Old September 22nd, 2003, 11:36 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can't. Each page hit (I.e. main window, iframe window) is completely independent. You can't interact with them with .Net. When you make load the main ASPX, it loads executes then spits out HTML to the browser. That page execution has lived and died. Now, there is HTML that tells the browser to go get another page (inside the iframe just like images or other URL based resources). This page request comes to your server which serves of another page. This page executes on it's own just like the first one, separate and apart from it.

So, in native .Net you can't get the two to talk. What you can do with JavaScript on the client however is up to you.

If you wanted to update data in the iframe with some data that has been affected with another frame of the page (two iframes, regular frames, etc) you could write out JS that causes the other pages to refresh or post so they'd refresh from their source data or whatever source has been changed.

Peter
  #3 (permalink)  
Old September 22nd, 2003, 11:41 AM
Registered User
 
Join Date: Sep 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Bummer. Kinda what I figured. Guess I'll get rid of the IFRAME and duplicate my navigation bars and other things on all forms.

  #4 (permalink)  
Old September 22nd, 2003, 11:49 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Well hold the phone there! Are you trying to avoid control duplication? You need to look into UserControls.

Peter


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with iframe content when refreshing page klax Javascript 0 April 21st, 2007 04:43 PM
how to prevent page jumping while click on iframe' kathirnk HTML Code Clinic 0 April 16th, 2007 06:39 AM
iframe refresh scrolls main page down kdm260 ASP.NET 2.0 Professional 0 May 16th, 2006 02:06 PM
targeting external page in another page's IFRAME nancy HTML Code Clinic 1 March 30th, 2006 03:22 PM
Change Page in iframe qazi_nomi Javascript How-To 10 February 21st, 2005 07:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.