Solved

Keeping navigation open when page refreshes

Posted on 2004-04-30
10
277 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
 
LVL 63

Expert Comment

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

Author Comment

by:fusionless
ID: 10961278
option 1
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

930 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now