Search results

Getting Started

This section briefly explains about how to create File Manager component in your ASP.NET MVC application. You can refer ASP.NET MVC Getting Started documentation page for introduction part part of the system requirements and configure the common specifications.

Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to include the license key in your projects. Please refer to this link to know about registering Syncfusion license key in your ASP.NET MVC application to use our controls.

Initialize the File Manager

To get started, add the File Manager component to index.cshtml page which is available within the Views/Home folder.

In this sample demonstrates the File Manager with default view.

razor
HomeController.cs
<div class="control-section">
    <div class="sample-container">
        <!--  Filemanager element declaration -->
        @Html.EJS().FileManager("file").AjaxSettings(new Syncfusion.EJ2.FileManager.FileManagerAjaxSettings{
            Url="https://ng2jq.syncfusion.com/ej2services/api/FileManager/FileOperations",
            GetImageUrl="https://ng2jq.syncfusion.com/ej2services/api/FileManager/GetImage"
        }).NavigationPaneSettings(ls => ls.Visible(false)).ContextMenuSettings(ls => ls.Visible(false)).ToolbarSettings(ls => ls.Visible(false)).Render()
        <!-- end of filemanager element -->
    </div>
</div>
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;

namespace WebApplication.Controllers
{
    public class HomeController : Controller
    {
        public IActionResult Index()
        {
            return View();
        }
    }
}

Output be like the below.

FileManager getting started

Injecting services for Overview

By default, the File Manager component not having any extra module. You can configure NavigationPane, Toolbar, ContextMenu module using Inject.

In this sample demonstrates the full features of the File Manager that includes toolbar, navigation pane and details view.

razor
HomeController.cs
<div class="control-section">
    <div class="sample-container">
        <!-- Declare filemanager element -->
        @Html.EJS().FileManager("filemanager").AjaxSettings(new Syncfusion.EJ2.FileManager.FileManagerAjaxSettings{
            Url="https://ng2jq.syncfusion.com/ej2services/api/FileManager/FileOperations",
            GetImageUrl="https://ng2jq.syncfusion.com/ej2services/api/FileManager/GetImage",
        }).View(Syncfusion.EJ2.FileManager.ViewType.Details).Render()
        <!-- end of filemanager element -->
    </div>
</div>
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;

namespace WebApplication.Controllers
{
    public class HomeController : Controller
    {
        public IActionResult Index()
        {
            return View();
        }
    }
}

Output be like the below.

FileManager overview