Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

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
:)





Report this thread to moderator Post Follow-up to this message
Old Post
Robert Mark Bram
09-30-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:44 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.