Solved

Keeping navigation open when page refreshes

Posted on 2004-04-30
10
276 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
Comment Utility
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
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
Comment Utility
can you so me how to do this?
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
This which, cookie or parameter?
0
 

Author Comment

by:fusionless
Comment Utility
option 1
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 63

Accepted Solution

by:
Zvonko earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I will try to do this on Monday.

So long Nice Weekend,
Zvonko

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
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…

771 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

9 Experts available now in Live!

Get 1:1 Help Now