Folder / File Browser with MVC 2?

How to create a route that takes the number of rows undefined? The folder browser should be able to view the specified folder and all subfolders. Using jQuery to return folders from the server. The problem is how to create jQuery?

$.ajax({
           type: "POST",
           url: "http://localhost:30218/Data/Folder1/Folder2/etc",
           dataType: "json",
           success: function (data) { }
       });

I mean, how can you create an MVC 2 URL that can look like 10 subfolders? I do not want to determine the static number of maximum folders that it can contain. How can you create a url and what routing to use? Quests for subfolders?

+3
source share
1 answer

You can use catchall on the last segment of the route, which is an asterisk symbol, for example:

"Files/{action}/{*path}"

, path.

+3

Source: https://habr.com/ru/post/1770256/


All Articles