Solved

treenode naviateurl

Posted on 2013-02-05
4
173 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
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 shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now