我有一个模型类
[HttpPost]
public ActionResult Upload(ViewModel model)
{
}
控制器
$("#myform").on("submit", function (event) {
event.preventDefault();
var formData = {
FileName: $('#fileName').val(),
File: $('#file').get(0).files[0],
};
$.ajax({
url: url,
type: "POST",
data: formData,
contentType:"multipart/form-data",
success: function (resp) {
}
});
查看
List<Employee> data;
我无法将模型发布到控制器?我做错了什么?