Skip to main content
A newer version of this page is available. .
Tab

FileManagerSettings.RootFolder Property

Gets or sets the root folder.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.2.dll

Declaration

[DefaultValue("")]
public virtual string RootFolder { get; set; }

Property Value

Type Default Description
String String.Empty

The path to the root folder.

Property Paths

You can access this nested property as listed below:

Remarks

This property is a wrapper of the FileSystemProviderBase.RootFolder property. Refer to its description for more information.

Note

  • We recommend you to specify the RootFolder property on Page_Init event.
  • If you change the RootFolder property value dynamically, it can result in the wrong thumbnails for files with coincident file names. In this case, specify a thumbnail folder (the FileManagerSettings.ThumbnailFolder) dynamically. To learn more, see the Security Considerations topic.
  • The root folder cannot be changed during its own callbacks. Instead, use postbacks or the ASPxCallbackPanel‘s callbacks.

Example

Web Forms (declaratively):

<dx:ASPxFileManager ID="fileManager" runat="server" ...>
    <Settings RootFolder="~/Content/FileManager/Files" ThumbnailFolder="~/Content/FileManager/Thumbnails" 
    AllowedFileExtensions=".jpg, .jpeg, .gif, .png" InitialFolder="~/Content/FileManager/Images"/>
    ...
</dx:ASPxFileManager>

Web Forms (in code):

ASPxFileManager fm = new ASPxFileManager();
fm.ID = "ASPxFileManager1";
fm.SettingsUpload.ValidationSettings.DisableHttpHandlerValidation = true;
Page.Form.Controls.Add(fm);
...
fm.Settings.RootFolder = Url.Content("~/Content/FileManager/Files");
fm.Settings.ThumbnailFolder = Url.Content("~/Content/FileManager/Thumbnails");
fm.Settings.InitialFolder = Url.Content("~/Content/FileManager/Images");
fm.Settings.AllowedFileExtensions=new String[] { ".jpeg", ".jpg", ".gif", ".png" };

MVC:

@Html.DevExpress().FileManager( settings => {
    settings.Name = "fileManager";

    settings.Settings.ThumbnailFolder = Url.Content("~/Content/FileManager/Thumbnails");
    settings.Settings.RootFolder = Url.Content("~/Content/FileManager/Files");
    settings.Settings.InitialFolder = "~/Content/FileManager/Images";
    settings.Settings.AllowedFileExtensions= new String[] { ".jpeg", ".jpg", ".gif", ".png" };
    ...
}).BindToFolder(Model).GetHtml()

Online Demo

The following code snippets (auto-collected from DevExpress Examples) contain references to the RootFolder property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also