[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Dynamic Include Navigation with ASP

Posted on 2006-06-29
8
Medium Priority
?
788 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 

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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

649 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