Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Keeping navigation open when page refreshes

Posted on 2004-04-30
Medium Priority
Last Modified: 2006-11-17
I have a pages which are built as ASP pages with a side navigation which is brought in through an <iframe>. In the side nav there is a function on the testimonials botton which expands the menu, this works however when the new page opens the menu shuts as the page refreshes. Can anyone tell me how to keep it open.

Question by:fusionless
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
LVL 63

Expert Comment

ID: 10960198
The iframe is loaded at every load of parent page.
So far is the src for the sidenav iframe fixed url without parameters.
Therefore is the sidenav iframe not able to open in previous expand state.
You have two options:
1.) Pass the expand state to clicked link, and back to iframe src.
2.) Store the expand state in browser cookie and recreate the expand state in the onLoad event of the iframe page.

I would recommand the first approach.


Author Comment

ID: 10960551
can you so me how to do this?
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 63

Expert Comment

ID: 10960859
This which, cookie or parameter?

Author Comment

ID: 10961278
option 1
LVL 63

Accepted Solution

Zvonko earned 1000 total points
ID: 10961641
Ok, it is not easy to follow, so I explain first the overall picture and give then the details.

1.) Your sublinks in the IFRAME need a parameter to tell the parent page that it was a sublink that asked for reload.
2.) Your parent pages need an onLoad handler which will look for that paramter in actual parent URL and pass the parameter to the IFRAME location.
3.) The IFRAME page needs a onLoad function to expand the div section if the parameter is present the same way as it would be clicked by the user.

That's all.

But that scenario is error prone if it is driven by client side and JavaScript. It would be better to addapt that sequence on ASP side.
Then its is nearly the same, but more secure.
The steps are the same but on ASP side.
1.) Your sublinks in the IFRAME ASP page need parameters for the parent load location.
2.) The ASP for the parent pages looks for URL parameters and appends them to the src URL of the IFRAME attribute.
3.) The ASP for iframe page generation looks for any passed parameters and creates a page with visible divs where they was colapsed before.

You see?

As sublink parameters I mean this:

<div id="main3sub1" style="position:absolute;height:24;top:88;left:0;visibility:hidden">
                  <table border="0" width="145" cellspacing="0" cellpadding="0">
      <td ><a href="candidates_testimonial1.asp" onMouseOut="MM_nbGroup('out');"  onMouseOver="MM_nbGroup('over','candidates_nav_sub_r2_c1', 'side_nav/sub_side_nav/candidates_nav_sub_r2_c1_f2.jpg', 'side_nav/sub_side_nav/candidates_nav_sub_r2_c1_f4.jpg',1)"  onClick="MM_nbGroup('down','navbar1', 'candidates_nav_sub_r2_c1', 'side_nav/sub_side_nav/candidates_nav_sub_r2_c1_f3.jpg',1)" target="_top" ><img name="candidates_nav_sub_r2_c1" src="side_nav/sub_side_nav/candidates_nav_sub_r2_c1.jpg" width="176" height="22" border="0"></a></td>

Add a parameter to the HREF.
Like this:
<a href="candidates_testimonial1.asp?navi=main3sub1"  ....

Author Comment

ID: 10966702
I think I know what you mean, could you clarify where to put the asp function which operates 'candidates_testimonial1.asp?navi=main3sub1' and so me an example it would be much appreciated.

Author Comment

ID: 10973520
hi Zvonko

are you able to clarify how the asp would work by showing where the appropriate code would go

Author Comment

ID: 11025372
Although I have sorted the problem using a far simpler method (including a seperate nav ifarame for the pages where the nav must stay open) I would still be interested if you could suggest asp code which would do the job in a more efficient way.
LVL 63

Expert Comment

ID: 11025395
I will try to do this on Monday.

So long Nice Weekend,


Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question