Forum Moderators: open

Message Too Old, No Replies

Variable css class based on page

To globalize tabbed navigation

         

Argblat

9:42 pm on Mar 16, 2005 (gmt 0)

10+ Year Member



Hi all,

I would like to globalize my the tabbed navigation that I am using throughout my website. However, in order to do this it would be necessary to dynamically edit the header file to put the id=current into the current <li> in the <ul> that forms the tabbed css navigation.

I am still very wet behind the ears with ASP and ASP.NET, so I would appreciate if someone could explain to me how to accomplish this.

I'm assuming that the code has to be "aware" of what page is being loaded, and set up a simple if statement based on this

i.e. if page 1 is beign loaded, tab 1 should be highlighted...if page 2 is being loaded...etc etc.

I do not, however, know how to use asp to make the file aware of what page is being loaded.

any help is greatly appreciated

Thank You,
Mike

dotme

9:48 pm on Mar 17, 2005 (gmt 0)

10+ Year Member



Hi Mike,

In ASP, Request.ServerVariables("SCRIPT_NAME") gets you the name of the current page.

Without seeing your code, it's difficult to know if this info helps. You could do this though...

<%
If Request.ServerVariables("SCRIPT_NAME") = "/page1.asp" Then
' Do something
ElseIf Request.ServerVariables("SCRIPT_NAME") = "/page2.asp" Then
' Do something else
End If