?
Solved

Dynamic Include Navigation with ASP

Posted on 2006-06-29
8
Medium Priority
?
789 Views
Last Modified: 2013-11-18
I see that NAVECHA has answered a query on this one but I got a little lost.

I have a simple navigation include file - ET2Nav.asp
Quote
<A href="et2Ware.asp">Warehousing & Storage </A>:
 <A href="et2vip.asp">VIP customers : </A>
 <A href="et2trans.asp">Transport Broking:</A>
  <A href="et2contact.asp">contact us</A>
Unquote
and what I am trying to do is ensure that when the Warehousing & Storage page - et2Ware.asp - opens up, the link to Warehousing and Storage does not show onthe nav bar.
Is that possible, or can it be highlighted?

kind regards

Misafi
0
Comment
Question by:Misafi
  • 4
  • 2
  • 2
8 Comments
 
LVL 4

Expert Comment

by:dukestaTAI
ID: 17011608
Here is one method you mayb have to modify it but this should get you started.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
      <title>Untitled</title>
      
<%

Function adjMenu(strLink)

If strLink = request.servervariables("url") Then
      response.write("style='visibility: hidden;'")
End If

End Function


%>
      
</head>

<body >

<A href="et2Ware.asp" <%adjMenu("/et2Ware.asp")%>>Warehousing & Storage </A>:
 <A href="et2vip.asp" <%adjMenu("/et2vip.asp")%>>VIP customers : </A>
 <A href="et2trans.asp" <%adjMenu("/et2trans.asp")%>>Transport Broking:</A>
  <A href="et2contact.asp" <%adjMenu("/et2contact.asp")%>>contact us</A>


</body>
</html>
0
 

Author Comment

by:Misafi
ID: 17012321
Thanks dukestaTAI
The links work but they still all show up - so ther is no difference from the original script.

rgds

Misafi
0
 
LVL 4

Expert Comment

by:dukestaTAI
ID: 17012356
Run this page and tell me what it says for URL: on the page.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
     <title>Untitled</title>
     
<%

Function adjMenu(strLink)

If strLink = request.servervariables("url") Then
     response.write("style='visibility: hidden;'")
End If

End Function


%>
     
</head>

<body >

<h1>URL:</h1><%=request.servervariables("url")%>

<A href="et2Ware.asp" <%adjMenu("/et2Ware.asp")%>>Warehousing & Storage </A>:
 <A href="et2vip.asp" <%adjMenu("/et2vip.asp")%>>VIP customers : </A>
 <A href="et2trans.asp" <%adjMenu("/et2trans.asp")%>>Transport Broking:</A>
  <A href="et2contact.asp" <%adjMenu("/et2contact.asp")%>>contact us</A>


</body>
</html>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Misafi
ID: 17012442
This is what it came up with - Ensign is the project name
URL:
/Ensign/url.asp Warehousing & Storage : VIP customers : Transport Broking: contact us

rgds
Misafi
0
 

Author Comment

by:Misafi
ID: 17035019
What happens now? I am not sure whether this question has been abandoned on not.
0
 
LVL 29

Accepted Solution

by:
rdivilbiss earned 1000 total points
ID: 17047356
>What I am trying to do is ensure that when the Warehousing & Storage page - et2Ware.asp - opens up, the link to Warehousing and Storage does not show onthe nav bar.

Since you are working with ASP, I would suggest an ASP solution.

In the menu include file, you may determine which page is loaded using the server variable, "SCRIPT_NAME" You can then test for the current page and not write it's menu link (or highlight it, etc.)

See my live example at http://www.rodsdot.com/ee/aspConditionalMenuLinks1.asp

ASP code for an example menu include file.

<%
' a variable to hold the currently loaded ASP page name.
Dim pageName

' get the page name from the server
pageName = Request.ServerVariables("SCRIPT_NAME")

' remove any preceding path
pageName = Mid(pageName, InStrRev(pageName,"/")+1)

' write a link only if it is NOT to this page.
if pageName <> "aspConditionalMenuLinks1.asp" then
      response.write "<a title=""ASP Conditional Menu Links Example Page 1"" href=""aspConditionalMenuLinks1.asp"">ASP Conditional Menu Links 1</a>&nbsp;|&nbsp;"
end if
if pageName <> "aspConditionalMenuLinks2.asp" then      
      response.write "<a title=""ASP Conditional Menu Links Example Page 2"" href=""aspConditionalMenuLinks2.asp"">ASP Conditional Menu Links 2</a>&nbsp;|&nbsp;"
end if
if pageName <> "aspConditionalMenuLinks3.asp" then      
      response.write "<a title=""ASP Conditional Menu Links Example Page 3"" href=""aspConditionalMenuLinks3.asp"">ASP Conditional Menu Links 3</a>"
end if
%>

You can improve on my code, but this should show you what is possible.

Regards,
Rod
0
 

Author Comment

by:Misafi
ID: 17048411
Perfect ! - thank you very much

Regards

Misafi
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 17050884
Glad to help. Good luck!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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…
Suggested Courses

809 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