当我在 Controller 中使用以下代码时
[HttpPost]
public ActionResult Index(HttpPostedFileBase file)
{
string path = Path.Combine(Server.MapPath("~/Images"),
Path.GetFileName(file.FileName));
file.SaveAs(path);
ViewBag.Message = "File Uploaded Successfully";
return View();
}
当我运行应用程序时,出现以下错误
---Server Error in '/' Application.
---The resource cannot be found.
当我删除[HttpPost]
它时加载但文件未上传...
谁能帮我?.......