This is a migrated thread and some comments may be shown as answers.

[Solved] Client events doesn't work with async upload

2 Answers 63 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sergey
Top achievements
Rank 1
Sergey asked on 06 Feb 2012, 01:09 PM
Hi,

I have a problem with clients events call for upload.
Here is my code:
@(Html.Telerik().Upload()
                .Multiple(false)
                .Name("attachments")
                .Async(async => async
                    .Save("TelerikUpload", "GraphicalElement")
                    .AutoUpload(false))
                    .ClientEvents(events => events
                    .OnUpload("onUpload")
                    .OnComplete("onComplete"))
            )
         
        <script type="text/javascript">
            function onComplete(e) {
                alert("Call event onComplete");
            }
 
            function onUpload(e) {
                alert("Call event onUpload");
            }
        </script>
and any event doesn't call after upload.
Can you explain what is wrong here?

2 Answers, 1 is accepted

Sort by
0
Jesh
Top achievements
Rank 1
answered on 20 Feb 2012, 06:05 AM
Hello,

I am also encountering the same problem.

Here's my ASPX code:
<%  Html.Telerik().Upload()
    .Name("file")
    .Multiple(false)
    .ShowFileList(true)
    .Async(async =>
            async.Save("Upload", "File")
            .AutoUpload(true)
    )
    .ClientEvents(events =>
        events.OnSuccess("UploadSuccess"))
    
.Render();
%>

And my Javascript:
<script type="text/javascript" language="javascript">
    function UploadSuccess(e) {
        alert("success");
    }
</script>

I have also tried renaming the JS function name, and the browser is able to detect the JS function if it exist or not, but the Client Event does not seem to get fired for some reason. Could this also be an environment problem that I have missed with my local machine? I tried to look everywhere, but I don't seem to find any luck.

Any help would be appreciated. Thanks in advance.
0
Jesh
Top achievements
Rank 1
answered on 22 Feb 2012, 04:16 AM
Hello,

I was able to resolve this issue, by upgrading my Telerik installation. Client events works fine now.

Thanks.
Tags
Upload
Asked by
Sergey
Top achievements
Rank 1
Answers by
Jesh
Top achievements
Rank 1
Jesh
Top achievements
Rank 1
Share this question
or