Forum Moderators: open

Message Too Old, No Replies

How can i do selected menu

selected

         

justify

7:38 am on Aug 12, 2003 (gmt 0)

10+ Year Member



Hi,
I am trying to create an asp webpage and I want to create a menu for it. When the user clik the menu button that is selected like www.cnn.com, I want to do it How can i do it. Can anyone advise to me?
Thanks in advance

ziggystardust

1:57 pm on Aug 14, 2003 (gmt 0)

10+ Year Member



The easiest (and least dynamic) way to solve this would be to just include a different set of HTML for your menu on each of the pages. Ie, on the weatherpage, you've got html that shows the weatherpart highlighted. No asp needed.

If you're dynamically generating your menu, for example from a database, you could assign each new menuitem a special directory on the server (the weather would be /weather/) and then include a check of what directory you're in (using ServerVariables) with your menuscript. If the directory matches the directory assigned to the menuitem in the database, you give that table row a different color or look.

//ZS

aspdaddy

3:26 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thats ok but if you make a change.....

Another way is to include the same menu on each page and use css, create a special "selected" style , and dynamically write the style names, based on the urls.

Yes, its a bit messy, but another option.

You have to first detemine the page name & then something like this for every link...


<div style="<% if pageName="Page1" then response.write "selected"%>">
<a href="page1.htm">Page1</a></div>

Anyone else?