Solved

treenode naviateurl

Posted on 2013-02-05
4
179 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:sevensnake77
  • 2
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 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:sevensnake77
ID: 38856786
error when using AbsolutePath
0
 
LVL 9

Author Closing Comment

by:sevensnake77
ID: 38857003
tks
0
 
LVL 40

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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