ComponentOne Extender Controls for ASP.NET Web Forms
Wijmo Control Toolkit Extender Controls / C1UploadExtender / C1UploadExtender Tutorial / Step 2 of 3: Adding Events to the Page
In This Topic
    Step 2 of 3: Adding Events to the Page
    In This Topic

    In this step, you will add some events for uploading files and showing the progress.

    1. With the C1UploadExtender control selected in the source, choose View | Properties Window in the Visual Studio menu.
    2. In the Properties window, add the following text next to the properties:

    1. Add the script that correspondswith the events:

    <script type="text/javascript">

        var supportXhr;

        var progressbar;

        function change(e, data) {

        }

        function complete(e, data) {

        }

        function progress(e, data) {

        }

        function totalComplete() {

            progressbar.fadeOut(1500, function () {

                if (supportXhr) {

                    $("#progressbar").wijprogressbar("option", "value", 0);

                }

            });

        }

        function totalProgress(e, data) {

            if (supportXhr) {

                $("#progressbar").wijprogressbar("option", "maxValue", data.total);

                $("#progressbar").wijprogressbar("option", "value", data.loaded);

            }

        }

        function totalUpload() {

            progressbar.show();

        }

        function upload(e, data) {

        }

        function pageLoad() {

            progressbar = $("#progressbar");

            supportXhr = $("#ctl00_MainContent_uploadPanel").wijupload("supportXhr");

            if (supportXhr) {

                progressbar.wijprogressbar({ value: 0 });

            } else {

                progressbar.addClass("Loading");

            }

            progressbar.hide();

        }

          </script>

    Now run the project to upload files.