This is a migrated thread and some comments may be shown as answers.

Get directory Name in ASP.NET AJAX

1 Answer 87 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 18 Feb 2020, 07:50 PM

Can someone please assist me with that issue. I'm trying to convert a WinForm to Webform. I need to access the main folder, It was implemented that way for the Winform, but I would like to have to retrieve the same path in ASP.NET AJAX for Webform.

 

 For WinForm:

string appPath = Path.GetDirectoryName(Application.ExecutablePath);

   DirectoryInfo info = Directory.Getarent(appPath);

WebForm: 

????

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 21 Feb 2020, 08:38 AM

Hi Jay,

You can use the Server.MapPath() method in order to get the physical path for a virtual one. For example;

        string path = Server.MapPath("~/Root/folder1");

 

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
FileExplorer
Asked by
Jay
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or