1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| 2. Controller,這邊特別注意<span style="color: blue;">HttpPostedFileBase</span> picture的參數名稱要與View file的name相同 ```csharp public ActionResult AddExhibitionItem(string name, string sort,string stop ,HttpPostedFileBase picture) { string err= string.Empty; if (ExhibitionUtilFactory.AddItem(name, sort, stop, picture, ref err)) { return Content("<script>alert('新增成功');window.parent.closeDialog();</script>"); } else { TempData["alert"] = err; return View(); } }
|