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

[Solved] Modernizr causing upload to fail

1 Answer 62 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.
Trent
Top achievements
Rank 1
Trent asked on 12 Mar 2012, 06:24 AM
Good afternoon,

In order to get Ajax.BeginForm working properly I had to make the following changes:

1. Reference the Modernizr scripts
2. Add 'jQuery(false)' to the script registrar
3. Reference "~/Scripts/jquery.unobtrusive-ajax.js" from my view

Since I did this I can't get the upload control to work synchronously. With the steps applied as above the 'IEnumerable<HttpPostedFileBase>' parameter passed to the controller is null. If I don't reference 'jquery.unobtrusive-ajax.js' the ajax.beginform submit refreshes the entire form, not just the target div.

Please advise?

Thanks!

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 12 Mar 2012, 01:51 PM
Hello,

Generally speaking, uploading files is not allowed through AJAX requests. This also applies to Ajax.BeginForm.

The upload gets around this by using the new File API or a hidden IFRAME (for older browsers). This is what the asynchronous mode does.

I hope this helps.

Regards,
Tsvetomir Tsonev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Upload
Asked by
Trent
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or