MVC异步上传文件
可以解决微软本身的异步方式无法上传文件的尴尬。
@using (Ajax.BeginForm("Index", "Ajax",new AjaxOptions() { Confirm= "确定上传文件吗?", HttpMethod = "post", OnSuccess = "fun" }, new { enctype = "multipart/form-data", id = "fileForm" }))
{
<input type="file" name="my_file" value="" />
<input type="button" id="btn_sub" name="but_submit" value="异步上传文件" />
}


评论