You must Sign In to post a response.
  • Category: ASP.Net MVC

    How to get open folder dialog box in mvc

    Are you looking for a way to get open folder dialog box in mvc ? then read this thread to know how get it


    I need to select folder path(not file selection) in web application, please share your idea if anyone achieved this.

    Lingaraj Varatharajan.
  • #750494
    Hello Lingaraj

    Your question is not clear, still you can get filepaths from perticular directory using GetFiles() function of c#
    i have post snippet below take a look.

    using System.IO;

    string[] filePaths = Directory.GetFiles("directory path");

    In this way you can get all list of files with filepath using this code.
    you have to provide directory path from which you want to get filepaths
    I hope this will help you, if still you have any issue than tell me , i'll get back to you.

    Nirav Prabtani (Senior Web Developer)
    Email :
    blog :

  • #750510

    There is no folder browse control in You should implement it with other options. You can go throw the below.

    Gopi A.
    +91 9894315571

  • #750513
    Hi Lingraj,

    I don't think, has any dedicated controls for folder selection.
    Instead you can use directory browsing to achieve this. FOr this you can use the below code -

    <%@ Import Namespace="System.IO" %>
    <% foreach(var file in Directory.GetFiles("C:\\Temp", "*.*", SearchOption.AllDirectories)) { %>
    <li><%= file %></li>
    <% } %>

    Also you may visit the below article as how to get the directory-

    Hope this will help you !!

    Ashutosh Jha

  • #750558
    There is no Open folder dialog box present in Web based application for security purpose.
    The browser does not have access to select client machine folder structure so ultimately there is no chance to select folders
    Final answer is you do not have Folder Open dialog box in based environment

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #750698
    The straight forward answer is no, there is only a option of File upload control and there is no Folder Browser option.

    if you still want to use it, make use of some third party control.

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • Sign In to post your comments