473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Accessing href attribute for menu system?

Hi All!

I have a menu system on my asp pages that use tables with a bunch of cells
like this:
<td class="menuHeader"><a href="../default.asp">Home</a></td>
<td class="menuEntry"><a href="../blog/default.asp">Blog!</a></td>
<td class="menuEntry"><a href="linkOMatic/default.asp">Link-O-Matic</a></td>

Now I want a system where one of the cells has a different class if that
page is being viewed. So, if default.asp is being viewed, that cell would
be:
<td class="classy"><a href="../default.asp">Home</a></td>

My question is how to do this. I have two ideas.

1)
Each page has an id..
<% var pageId=33; %>

<td class="<%=(pageId=33?"classy":"menuHeader")%>"><a
href="../default.asp">Home</a></td>

I know this one will work ok, but it is clumsy - I will have to handcode
each menu item and give each page a pageId just to implement this.

2)
This is what I was thinking of instead:
<td class="<%=(Request.ServerVariables("SCRIPT_NAME")= =THIS
HREF?"classy":"menuHeader")%>"><a href="../default.asp">Home</a></td>
Is there a way to write ASP that can access the HREFF attribute of the
anchor tag in this way? If I could do this, I would not need to hand code
anything - all the changes could be made with a find-replace.

Thanks for any advice!

Rob
:)


Jul 19 '05 #1
0 1256

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Andrea | last post by:
Hi everyone, I am in the process of learning javascript and have a question on location.href. Does javascript always require the <script language = "javascript"> (or script...
4
by: Marcello | last post by:
Hello I have a page of 2 frame: menu (menu.php) corpo (corpo.php) In menu.php i have: <script> function selAut(){ aut=autore.selectedIndex; aut=autore.options.value;
1
by: Jiri Brada | last post by:
Hi, I have got a following problem with using Javascript: I have a HTML page with pictures' thumbnails. After clicking on any thumbnail, I would like to open a new window with the original...
1
by: Rose Girl | last post by:
Can someone help me on this little problem. I am using the following code in an xsl page. The directed page is written in the javascript: submitOnClick(); <a href="#"> <xsl:attribute...
9
by: Sunny | last post by:
Hi, I have cr8ed a javascript function in the head section of a jsp page. <!-- function go(theURL) { alert(theURL); if (theURL!=null){
16
by: michael | last post by:
Is it possible to get all href URLs contained in a unordered list and place them in an array? Or in fact two different arrays, differently named one for each <ul> group? <ul> <li><a...
2
by: Isz | last post by:
Hi Group: I would like to know if it is possible to change the name of an attribute to something else. My setup is like this: I have serveral SQL tables that I nest and join so that it all...
1
by: me | last post by:
Hello, I have serveral xml files that will have the same formatting, like this: <bio> <title>xxxxx</title> <info>yadayadayada</info> <source>Bill Gates</source>
1
by: nsvmani | last post by:
Hi, i am trying to get the FileOpen dialogue window as soon as clicked href link I am using IE6 with ActiveX enabled. Just need to get the File Open dialogue window when i click on the HREF links.It...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.