Kendo ui upload events

Kendo ui upload events

@using (Html.BeginForm("UploadSubscribers", "Connect", FormMethod.Post, new { id = "IsValid", enctype = "multipart/form-data" }))
{
    <div class="panel panel-info">
        <div class="panel-heading">
            <h3 class="panel-title">
                Upload excel files for subscribers and subscriptions.
            </h3>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-sm-9">
                    @(Html.Kendo().Upload()
                    .Name("files")
                    .Multiple(false)
                    .HtmlAttributes(new { required = true })
                    .Events(events => events
                    .Cancel("onCancel")
                    .Complete("onComplete")
                    .Error("onError")
                    .Progress("onProgress")
                    .Remove("onRemove")
                    .Select("onSelect")
                    .Success("onSuccess")
                    .Upload("onUpload")
                    )
                </div>
            </div>
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="pull-right">
        <button type="submit" id="btnExcelUpload" class="btn btn-primary">Upload</button>
        <a id="btnCancel" class="btn btn-primary">Cancel</a>
    </div>
    <div class="clearfix"></div>
}

<script>
    var onSelect = function (e) {
        if (e !== undefined && e !== null) {
            //TODO:..
        }
    };

    var onCancel = function (e) {
        if (e !== undefined && e !== null) {
            var window = $("#window");
            if (window !== undefined && window !== null) {
                window.data("kendoWindow").close();
            }
        }
    };

    var onComplete = function (e) {
        if (e !== undefined && e !== null) {
            //TODO:as per you.
        }
    };
    var onError = function (e) {
        if (e !== undefined && e !== null) {
            //TODO:as per you.
        }
    };
    var onProgress = function (e) {
        if (e !== undefined && e !== null) {
            //TODO:as per you.
        }
    };
    var onRemove = function (e) {
        if (e !== undefined && e !== null) {
            //TODO:as per you.
        }
    };
    var onSuccess = function (e) {
        if (e !== undefined && e !== null) {
            //TODO:as per you.
        }
    };
    var onUpload = function (e) {
        if (e !== undefined && e !== null) {
            //TODO:as per you.
        }
    };
</script>
ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..
My Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.