当点击提交按钮后,想在Controll里取到Form里的数据。
必须在控件上设置name属性 例如<input type='text',name='userId'/>,
在controll的Action里接收如下
public ActionResult Login(FormCollection form)
{
string userid=form["userID"];
return view();
}
如果不设置input的name属性,发现action里form总是为空!