1.前台需要form表单
eg:
<form action="/Home/Add" id="myform" method="post" style="border:1px solid #ff0000"> <table> <tr> <td>姓名:</td> <td><input type="text" id="name" name="name" placeholder="请输入姓名" value="" /></td> </tr> <tr> <td>年龄:</td> <td> <select id="age" name="age"> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> </select> </td> </tr> <tr> <td><input type="submit" id="btn_add_1" value="添加" /></td> </tr> </table> </form> 注意:必须要name属性,不然没有值2.后台
public ActionResult Add_1(FormCollection form) { string name =form["name"]; int age = Convert.ToInt32(form["age"]); return View(); } 有view就返回view