url variables, iframes, and ???

Reply

Join Date: Aug 2008
Posts: 15
Reputation: dlacloche is an unknown quantity at this point 
Solved Threads: 1
dlacloche's Avatar
dlacloche dlacloche is offline Offline
Newbie Poster

url variables, iframes, and ???

 
0
  #1
Feb 26th, 2009
This is boggling my mind right now.

Here's what a client wants:

On the index page, there is an iframe with links inside it. When you click on a link, it opens the page (not in the iframe, but in the top level) and sends a url string variable. This 2nd page (or details page) also contains an iframe that has dynamic content inside of it that needs to be displayed based on which link was clicked from the index page's iframe.

How do I get the variable from the url string to be available for use inside the iframe of the second page?
Thank you, thank you. :-D
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 25
Reputation: efaith77 is an unknown quantity at this point 
Solved Threads: 1
efaith77's Avatar
efaith77 efaith77 is offline Offline
Light Poster

Re: url variables, iframes, and ???

 
0
  #2
Feb 26th, 2009
What you have there is a very unique problem. I can not think of a reason anyone would want to do that. You could probably acheive this effect with some Java script.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,388
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 168
almostbob's Avatar
almostbob almostbob is online now Online
Nearly a Posting Virtuoso

Re: url variables, iframes, and ???

 
0
  #3
Feb 27th, 2009
I can do it in php => implies there is a method in ASP
but why an iframe
an include menu is more compliant with more browser types that dont support iframes
any how

in the iframe menu
  1. <a href='/index.php?something=value1' target='_top'>page1</a>
  2. <a href='/index.php?something=value2' target='_top'>page2</a>
  3. <a href='/index.php?something=value3' target='_top'>page3</a>
  4. <a href='/index.php?something=value4' target='_top'>page4</a>
  5. <a href='/index.php?something=value5' target='_top'>page5</a>
  6. <a href='/index.php?something=value6' target='_top'>page6</a>

index.php page
  1. <!doctype blah bla>
  2. <html blah bla>
  3. <head>
  4. bla bla
  5. </head>
  6. <body>bla bla
  7. <iframe src="<?php echo $something; ?>" width='bigenough' height='tallenough' frameborder='0'>iframe</iframe>
  8. </body></html>
cant guarantee the syntax for ASP but there must be an analog
Last edited by almostbob; Feb 27th, 2009 at 1:11 am.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 119
Reputation: agrothe is an unknown quantity at this point 
Solved Threads: 14
agrothe's Avatar
agrothe agrothe is offline Offline
Junior Poster

Re: url variables, iframes, and ???

 
0
  #4
Feb 28th, 2009
Ok, this isn't really hard. You just need javascript. Of course navigation with JavaScript is almost never a good idea, but here is how.

I'm assuming you have a page called index.asp. index.asp has an iframe called iframe_index.asp. We will link to a page called target.asp with an iframe called target_iframe.asp.

So first your javascript. In the head of your index.asp put:
  1. function nav(target){<blockquote>window.location='target.asp?param='+target;</blockquote>}

Ok, so this javascript function navigates to target.asp with a dynamic param querystring.

On our iframe_index.asp we have the following links:
  1. <a href="javascript:window.top.nav(1)">link1</a>
  2. <a href="javascript:window.top.nav(2)">link2</a>
  3. <a href="javascript:window.top.nav(3)">link3</a>

This code calls the nav function on our index.asp page and redirects us to target.asp

Target.asp uses the following iframe:
  1. <iframe src="target_iframe.asp?param=<%=request.querystring("param")%>"></iframe>

Now, in your target_iframe.asp code, you can do another request.querystring("param") to get the value passed from the iframe_index.asp page and do whatever with it.

DISCLAIMER:
Your iframes must reside on the same domain and server in order for this to work, and you may have some cross-browser issues. I don't recommend using this, but this is how you can do it. You could use sessions and ajax and a few other methods as well.

Cheers.
------------------------------------------------------------
If you see no coffee in my immediate vicinity, speak slowly and use small words....
ConnectNL Directory | Blog
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 15
Reputation: dlacloche is an unknown quantity at this point 
Solved Threads: 1
dlacloche's Avatar
dlacloche dlacloche is offline Offline
Newbie Poster

Re: url variables, iframes, and ???

 
0
  #5
Mar 4th, 2009
Okay. Cool. Thanks for all the help. I'm going to read thru this thread a few times then give it a try!
Thank you, thank you. :-D
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



Tag cloud for ASP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC