We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Upload Button in Custom Toolbar

Thread ID:





132532 Sep 6,2017 10:59 PM Sep 7,2017 11:11 AM ASP.NET MVC 1
Tags: Grid
Asked On September 6, 2017 10:59 PM

Is there any example to render file upload control in ASP.Net MVC Grid custom tool bar.
This is to enable bulk upload of records via web page


Thavasianand Sankaranarayanan [Syncfusion]
Replied On September 7, 2017 11:11 AM

Hi Enrochem, 

Thanks for contacting Syncfusion support. 

As per your request we have prepared a ASP.NET MVC Grid sample with upload box in custom toolbar and sample can be downloadable from the below location. 

Refer the below code example. 

            .ToolbarSettings(toolbar => 
                    toolbar.ShowToolbar(true).CustomToolbarItems(new List<object>() { "Upload", new Syncfusion.JavaScript.Models.CustomToolbarItem() { TemplateID = "#UpLoad" } }); 
                .ClientSideEvents(clientevent => clientevent.Create("create")) 
        .Columns(col => 
<script id="UpLoad" type="text/x-jsrender"> 
    <div class="uploadcontrol"> 
        <div id="UploadDefault"></div> 
<script type="text/javascript"> 
    function create(args) { 
            saveUrl: "/../Handler1.ashx", 
            autoUpload: true, 
            showFileDetails: false, 
            fileSize: 1048576, //bytes, 
public void ProcessRequest(HttpContext context) 
            string targetFolder = HttpContext.Current.Server.MapPath("uploadfiles"); 
            if (!Directory.Exists(targetFolder)) 
            HttpRequest request = context.Request; 
            HttpFileCollection uploadedFiles = context.Request.Files; 
            if (uploadedFiles != null && uploadedFiles.Count > 0) 
                for (int i = 0; i < uploadedFiles.Count; i++) 
                    if (uploadedFiles[i].FileName != null && uploadedFiles[i].FileName != "") 
                        string fileName = uploadedFiles[i].FileName; 
                        int indx = fileName.LastIndexOf("\\"); 
                        if (indx > -1) 
                            fileName = fileName.Substring(indx + 1); 
                        uploadedFiles[i].SaveAs(targetFolder + "\\" + fileName); 

For more information on rendering custom toolbar in Grid, refer the following Knowledge base documentation. 

Refer the help documentation. 

Thavasianand S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.