Solved

Keeping navigation open when page refreshes

Posted on 2004-04-30
10
278 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
  • 6
  • 4
10 Comments
 

Author Comment

by:fusionless
ID: 10960045
0
 
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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 250 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

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…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

773 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