我收到错误,告诉我有预期的标识符?
代码:
[HttpPost]
public ActionResult EditProduct(int id, FormCollection collection)
{
ProductRepository repo = new ProductRepository();
var product = repo.GetProductID(id);
string Pid = collection["Pid"];
string name = collection["PName"];
string type = collection["PType"];
string deal = collection.["PDeal"];
string desc = collection.["PDescription"];
string price = collection.["PPrice"];
repo.Save();
return View("index");
}
答案 0 :(得分:7)
这三行中有一个额外的.
:
string deal = collection.["PDeal"];
string desc = collection.["PDescription"];
string price = collection.["PPrice"];