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

[Solved] Upload is not working with Tab LoadOnDemand option

1 Answer 46 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.
Mudassar
Top achievements
Rank 1
Mudassar asked on 13 Apr 2011, 01:46 PM
Hi,
  guys, upload control is not working(IE 8/9,FF4) with window and tab load on demand option.
i am attaching a sample project please take a look and guide. 

Regards,
Mudassir

1 Answer, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 13 Apr 2011, 03:51 PM
Hi Muhammad,

Thank you for submitting a sample project. If you open the error console you'll see that the Upload can't find the UploadProfileImage_OnUpload event handler. The reason is that the handler is defined after the upload. Switching their places solves the problem:
<script type="text/javascript">
 
    function UploadProfileImage_OnUpload(e) {
    }
 
</script>
 
<%= Html.Telerik().Upload()
        .Name("attachments")
        .Async(async => async.Save("UploadProfileImage", "Home"))
        .ClientEvents(events => events.OnUpload("UploadProfileImage_OnUpload"))
%>

The other problem I spotted is that the Upload is named attachments, but you expect an 'attachment' parameter in the controller. Making them equal should solve that problem as well:
[HttpPost]
public ActionResult UploadProfileImage(HttpPostedFileBase attachments)

Best Regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Upload
Asked by
Mudassar
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or