views:

1810

answers:

4

Can someone give me an example of how to do this with ASP.Net MVC? I have followed the example at their site on the file uploads tab but I cannot get a decent response back. My controller thinks that it is not a AJAXRequest and tries to do a RedirectToAction but that doesn't change the page after the post.

A: 

Try this my friend: http://www.hanselman.com/blog/ABackToBasicsCaseStudyImplementingHTTPFileUploadWithASPNETMVCIncludingTestsAndMocks.aspx

Andrew Siemer
That doesn't use the jQuery Form Plugin
Jon
Perhaps you would prefer this post then! http://forums.asp.net/p/1298139/2527969.aspx#2527969
Andrew Siemer
A: 

The upload isn't an AJAX request, it states clearly that you can't do a file upload using the XMLHttpRequest object so it's done using an iframe as the target. Try processing the upload just as you would for a normal non-AJAX submission.

Lazarus
I do, I check the Request.IsAJAXRequest property and then do a RedirectToAction("Index") but I don't get redirected to Index it just comes back to my form page.
Jon
A: 

Answer: Cannot use AJAX or use iFrame

Jon
+2  A: 

I wrote a blog post about how to do this here.

JohnRudolfLewis
Thanks a lot. You saved me :)
Gopinath