Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

treenode naviateurl

Posted on 2013-02-05
4
Medium Priority
?
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

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 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

670 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