0
我實現了兩個動作:如何檢索方法POST URL參數[ASP.NET MVC]
它呈現URL中與消費者ID地址查看第一個動作:
這是URL http://localhost:90/Consumer/Address?id=18755
[HttpGet]
public ActionResult Address(int id)
{
return View();
}
第二個動作是職位地址形式:
[HttpPost]
public ActionResult Address(FormCollection value)
{
int id = Convert.ToInt32(Request["id"]);
// Some code ...
return View();
}
當我發動保存操作時,我發現ID爲空,我想從Get操作中檢索conusmer ID?