Skip to main content
Tab

FileManagerSettings.UseAppRelativePath Property

Gets or sets a value indicating whether the path to the current folder within the path box is relative to the root folder or application.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(false)]
public virtual bool UseAppRelativePath { get; set; }

Property Value

Type Default Description
Boolean false

true if the path is relative to the application; false if the path is relative to the root folder.

Property Paths

You can access this nested property as listed below:

Object Type Path to UseAppRelativePath
ASPxFileManager
.Settings .UseAppRelativePath

Remarks

Use the UseAppRelativePath property to specify the directory to which the folder path within the path box is relative.

  • true - the path to the current folder within the path box is relative to the application.

    RootFolder="~/Content/FileManager/Files" UseAppRelativePath="true"
    

    ASPxFileManager_UseAppRelativePathTrue

  • false - the path to the current folder within the path box is relative to the root folder.

    RootFolder="~/Content/FileManager/Files" UseAppRelativePath="false"
    

    ASPxFileManager_UseAppRelativePathFalse

Note

The UseAppRelativePath property is not in effect if the root folder is outside the application.

Example

Web Forms (in markup):

<dx:ASPxFileManager ID="fileManager" runat="server" ...>
    <Settings RootFolder="~/Content/FileManager/Files" ThumbnailFolder="~/Content/FileManager/Thumbnails" 
    AllowedFileExtensions=".jpg, .jpeg, .gif, .png" InitialFolder="~/Content/FileManager/Images"
    UseAppRelativePath="true" >
    ...
</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" };
fm.Settings.UseAppRelativePath=true;

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" };
    settings.Settings.UseAppRelativePath=true;
    ...
}).BindToFolder(Model).GetHtml()
See Also