Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

treenode naviateurl

Posted on 2013-02-05
4
Medium Priority
?
186 Views
Last Modified: 2013-02-05
I would like to pull only the dynamic path and not the full path to my tree node Naviateurl
I tried server.mappath but get and error. example below.

Dim files As FileInfo() = thisDir.GetFiles("*.*")
For Each file As FileInfo In files
            Dim thisFileNode As New TreeNode(file.Name, Nothing, "Images/file.gif")
            thisDirNode.ChildNodes.Add(thisFileNode)
hisFileNode.NavigateUrl = file.DirectoryName.ToString + file.name
Next


('C:/inetpub/wwwroot/pdfs/State/01082013/00000/010813010206.PDF')


to

/State/01082013/00000/010813010206.PDF
0
Comment
Question by:Seven price
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 1500 total points
ID: 38856701
Dim RelativePath as String = AbsolutePath.Replace(Request.ServerVariables("APPL_PHYSICAL_PATH"), String.Empty)

Then you can use the RelativePath variable.
0
 
LVL 9

Author Comment

by:Seven price
ID: 38856786
error when using AbsolutePath
0
 
LVL 9

Author Closing Comment

by:Seven price
ID: 38857003
tks
0
 
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 38857006
AbsolutePath is the string of the file.

eg:  Http://MyServer/pdfs/State/01082013/00000/010813010206.PDF
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

971 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