| | |
url variables, iframes, and ???
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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?
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
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.
Some of my work.
http://www.backroads-inc.com
http://www.pctradepost.net
http://www.movieboxes.net
[SIGPIC][/SIGPIC]
http://www.backroads-inc.com
http://www.pctradepost.net
http://www.movieboxes.net
[SIGPIC][/SIGPIC]
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
index.php page
cant guarantee the syntax for ASP but there must be an analog
but why an iframe
an include menu is more compliant with more browser types that dont support iframes
any how
in the iframe menu
html Syntax (Toggle Plain Text)
<a href='/index.php?something=value1' target='_top'>page1</a> <a href='/index.php?something=value2' target='_top'>page2</a> <a href='/index.php?something=value3' target='_top'>page3</a> <a href='/index.php?something=value4' target='_top'>page4</a> <a href='/index.php?something=value5' target='_top'>page5</a> <a href='/index.php?something=value6' target='_top'>page6</a>
index.php page
php Syntax (Toggle Plain Text)
<!doctype blah bla> <html blah bla> <head> bla bla </head> <body>bla bla <iframe src="<?php echo $something; ?>" width='bigenough' height='tallenough' frameborder='0'>iframe</iframe> </body></html>
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
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
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:
Ok, so this javascript function navigates to target.asp with a dynamic param querystring.
On our iframe_index.asp we have the following links:
This code calls the nav function on our index.asp page and redirects us to target.asp
Target.asp uses the following 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.
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:
ASP Syntax (Toggle Plain Text)
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:
ASP Syntax (Toggle Plain Text)
<a href="javascript:window.top.nav(1)">link1</a> <a href="javascript:window.top.nav(2)">link2</a> <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:
ASP Syntax (Toggle Plain Text)
<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
If you see no coffee in my immediate vicinity, speak slowly and use small words....
ConnectNL Directory | Blog
![]() |
Similar Threads
Other Threads in the ASP Forum
- Previous Thread: problem with command object
- Next Thread: Upload a EXcel Sheet
Views: 1389 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for ASP
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile query record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit update web webserver windows7






