Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Path is not a valid virtual path

Tags:

c#

asp.net

The below method takes a path pointing to an xml file:

tree.LoadContentFile(path);

I pass a complete path from my local file system (or use Server.MapPath()), but everytime I keep getting this error:

[Path] is not a valid virtual path.

EDIT: I am using Telerik RadTreeView.

A sample path is: "C:\inetpub\wwwroot\sitename\OutlookNavigation\tree.xml"

What am I doing wrong?

like image 752
GurdeepS Avatar asked Jun 03 '09 00:06

GurdeepS


1 Answers

.NET is expecting a path like

~/folder/file.txt

or /folder/file.txt

which it will translate into a physical path.

like image 145
harpo Avatar answered Oct 24 '22 19:10

harpo