阅读背景:

JQuery文件上载对话框没有从MVC Controller操作返回到对话框

来源:互联网 

I have an ASP.NET MVC app which uses a jquery ui dialog for file upload. Everything is working fine with loading the dialog with the correct content and displaying the dialog on my click event however my issue is that after I process the action in my controller action method I don't return back to my dialog as I would expect an ajax like call to behave. My dialog is a form whose "method=post". I believe this is the issue. When I post the form I no longer have context to the dialog. If I remove the "method=post" from my form tag I get a 404 not found on my controller action. I will say that I have tried various methods to do what I want to accomplish but each method has not worked for one reason or another. Originally I tried the .$(post) method to fire my controller action but found that the Request.Files was not getting set when I tried to process it in my controller action. I also tried using Html.BeginForm instead of the html however I ran into the same issue of not returning to the dialog. The net result is a blank browser page with the words Success which is the return of my action method. My latest attempt is to use the jquery method .ajaxForm. This calls my action and has the filepath name to be uploaded but it too does not return to the dialog. Here is my code:I have an ASP.NET MVC app which uses a jquery u




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: