Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:27 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.