- http://www.cnblogs.com/M-LittleBird/p/5855973.html
- http://www.cnblogs.com/firstcsharp/p/4967569.html
//默认为Get方法请求
public ActionResult PostDemo()
{
return View();
}
//标记为Post方式请求,改方法就只能接受post方法请求
[HttpPost]
public ActionResult PostDemo(FormCollection form)
{
//第一种获取提交表单的方式
string name = Request.Form["name"];
ViewBag.name = name;
//第二种获取提交表单的方式
string name2 = form["name"];
ViewBag.name2 = name2;
return View();
}