1.FormCollection collection user.UserId =Convert.ToInt32(collection["UserId"]);
/// <summary>
/// 更新
/// </summary>
/// <param name="userId"></param>
/// <param name="collection"></param>
/// <returns></returns>
[HttpPost]
public ActionResult Edit(FormCollection collection)
{
try
{
Users user = new Users();
user.UserId =Convert.ToInt32(collection["UserId"]);
}
}
2.Request.Form["UserId"]
/// <summary>
/// 更新
/// </summary>
/// <param name="userId"></param>
/// <param name="collection"></param>
/// <returns></returns>
[HttpPost]
public ActionResult Edit(FormCollection collection)
{
try
{
Users user = new Users();
user.UserId=Convert.ToInt32(Request.Form["UserId"]);
}
}