MVC使用Ajax.BeginForm上传图片时HttpPostedFileBase file为null,Request.Files获取不到文件,问题分析是页面中存在jquery.unobtrusive-ajax.js文件,注释后能够获取到。改为Html.BeginForm实现如下:
@using (Html.BeginForm("UploadPhoto", "EditUserInfo", FormMethod.Post, new { enctype = "multipart/form-data" })) { 选择图片: <input type="file" name="uploa 阅读全文>>