?
Solved

Keeping navigation open when page refreshes

Posted on 2004-04-30
10
Medium Priority
?
285 Views
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.

thanks
0
Comment
Question by:fusionless
[X]
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
10 Comments
 
LVL 63

Expert Comment

by:Zvonko
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.

0
 

Author Comment

by:fusionless
ID: 10960551
can you so me how to do this?
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 63

Expert Comment

by:Zvonko
ID: 10960859
This which, cookie or parameter?
0
 

Author Comment

by:fusionless
ID: 10961278
option 1
0
 
LVL 63

Accepted Solution

by:
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">
                        <tr>
                              
      <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>
                        </tr>
                  </table>
            </div>

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

Author Comment

by:fusionless
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.
0
 

Author Comment

by:fusionless
ID: 10973520
hi Zvonko

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

Author Comment

by:fusionless
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.
0
 
LVL 63

Expert Comment

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

So long Nice Weekend,
Zvonko

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…
Suggested Courses

762 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