SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old March 25th, 2003, 08:24 AM
INF INF is offline
Standards User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 146 INF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 4 sec
Reputation Power: 6
Including Menu In Certain Directories

I'm including a template on all pages in a site. In the template I have a menu. What I'd like is to have a different menu displayed if I'm in a different directory.
Something along the lines of:

If path is /mainsite Then
Regular Menu
If path is /admin Then
Admin Menu

Just not sure about how to go about getting there. My first thought was to use the PATH_INFO server variable, but that returns the page name too.
Any suggestions?

Reply With Quote
  #2  
Old March 25th, 2003, 02:33 PM
ngibsonau ngibsonau is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 138 ngibsonau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
For getting a path use server.Mappath()

depending how you setup your website you can also use server side inludes

ie.

<!--#include file="page.asp"-->
and
<!--#include virtual="page.asp"-->

The virtual include will require extra server setup to work properly
__________________
--

ngibsonau

Reply With Quote
  #3  
Old March 27th, 2003, 01:56 AM
yassoor's Avatar
yassoor yassoor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada - Egypt
Posts: 60 yassoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
you could also use the

Request.ServerVariables("SCRIPT_NAME")

which will give a full path of the current page, starting at the root of the server "/" and you could use that to parse it and put all the if staments that u want

I hope this is of any help.
__________________
I hope this is of any help to anyone.

Yassoor
http://www.WebsitesCreation.ca

Reply With Quote
  #4  
Old March 28th, 2003, 02:54 PM
INF INF is offline
Standards User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 146 INF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 4 sec
Reputation Power: 6
Thanks guys.

Looks like I really need to practice my If Then Statements. I'm trying to do this without a page name, because there are many pages in each directory.

Although not the exact method I hoped to use, I did get the intended effect by just creating a variable called ShowMenu, then setting that to 1 on each page I want the menu to display on.

If you could show me a better way than I've done, it would be appreciated. Thanks again for your suggestions.

Reply With Quote
  #5  
Old April 1st, 2003, 01:42 AM
defjamninja defjamninja is offline
Overly white
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Fresno, CA
Posts: 83 defjamninja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Try this code on for size.
Code:
<%
	dim strPath
	dim intPos
	strPath = lcase(Request.ServerVariables("SCRIPT_NAME"))

	intPos = Instr(1,strPath,"/admin/")

	If intPos > 0 Then
		response.write("Admin")
	else
		response.write("Other")
	end if
%>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Including Menu In Certain Directories


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway