How to select a folder using ASP.NET

I want to select a folder using asp.net, when I click the browse button, a file selection dialog will open.

+3
source share
2 answers

There is no html control for selecting folders, so this is not possible with ASP.Net.

+1
source

You can add:

1- the folder browser dialog (for the folder) and use it Like This:

    `if(folderBrowserDialog1.ShowDialog() != DialogResult.Cancel)
         string str = DialogFolderBrows.SelectedPath;`

2- Open the file dialog box (for the file)
   and use it Like This:

   `if(openFileDialog1.ShowDialog() != DialogResult.Cancel)
         string str = DialogOpenFile.FileName;` 
-1
source

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


All Articles