473,320 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to get PATH?

I have an application the uses usercontrols (sidebar.ascx, sidebar1.ascx,
ect.))to display a side menu with content that will vary depending on what
folder the user is currently accessing.
like this:
root/folder1/somepage.aspx or root/folder2/somepage.aspx

I think there should be an easy(?) way to get the path of the folder
containg the page the user is trying to access to load the proper .ascx page
into the user control. The ascx pages are different depending on the folder
accessed. Is this possible?
The only other way I can think of to do this is to just put the proper .ascx
page into each folder and access them that way.

Something like this:

If Path = root/somefolder1/ Then
usercontrol=sidebar1.ascx
ElseIf Path= root/somefolder2/ Then
usercontrol=sidebar2.ascx
End If

TIA,
Mark
Nov 18 '05 #1
1 1818

"Mark" <py*******@hotmail.com> wrote in message
news:up**************@TK2MSFTNGP11.phx.gbl...
I have an application the uses usercontrols (sidebar.ascx, sidebar1.ascx,
ect.))to display a side menu with content that will vary depending on what
folder the user is currently accessing.
like this:
root/folder1/somepage.aspx or root/folder2/somepage.aspx

I think there should be an easy(?) way to get the path of the folder
containg the page the user is trying to access to load the proper .ascx page into the user control. The ascx pages are different depending on the folder accessed. Is this possible?
The only other way I can think of to do this is to just put the proper ..ascx page into each folder and access them that way.

Something like this:

If Path = root/somefolder1/ Then
usercontrol=sidebar1.ascx
ElseIf Path= root/somefolder2/ Then
usercontrol=sidebar2.ascx
End If


If each subfolder has its own usercontrol, obviously it's better to just
put the proper usercontrol into each folder.

If somehow, some of the usercontrols are common to multiple subfolders,
then you can retrieve the path with Page.TemplateSourceDirectory

More about paths in ASP.NET:
http://west-wind.com/weblog/posts/269.aspx
Jos


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff...
9
by: Bengt dePaulis | last post by:
I have a local directory that I want to include in my sys.path How to save it permanently? Regards /Bengt
70
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
2
by: Rob Cowie | last post by:
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string...
1
by: William Stacey [MVP] | last post by:
I need a bullet proof way to combine a root and a relative path to form a FQ rooted path (similar to a VDir in IIS). Path.Combine alone will not do the job in all cases. I also need to be sure...
4
by: python | last post by:
Bad file names, i.e. filenames the OS considers illegal, will cause functions in the os.path module to raise an error. Example: import os.path print os.path.getsize( 'c:/pytest/*.py' ) On...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
8
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml...
6
by: bukzor | last post by:
I have to go into these convulsions to get the directory that the script is in whenever I need to use relative paths. I was wondering if you guys have a better way: from os.path import dirname,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.