Search results

Trigger Click Event of Input File from External Button in ASP.NET MVC Uploader control

You can trigger the click event of input file from external button using click event of button. In the below sample, triggered click event of input file from Essential JavaScript 2 Button.

<div class="col-lg-8 control-section">
    <div class="control_wrapper">
        <div id="dropArea">
            <span id="drop"> Drop image (JPG, PNG) files here or <button class='e-btn e-control' id="browse">Browse</button></span>
        @Html.EJS().Uploader("UploadFiles").DropArea("#drop").AsyncSettings(new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "", RemoveUrl = "" }).Render()


    window.onload = function () {
        document.getElementById('browse').onclick = () => {

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace EJ2CoreSampleBrowser.Controllers.TextBoxes
    public partial class UploaderController : Controller
        public ActionResult DefaultFunctionalities()
            return View();
.control_wrapper {
        max-width: 500px;
        margin: auto;
    #dropArea {
        border: 1px dashed #c3c3cc;
        text-align: center;
        padding: 20px 0 10px;

    .e-file-select-wrap {
        display: none;

    .control_wrapper .e-upload .e-upload-drag-hover {
        margin: 0;