一、指定表单提交方式和路径等spa
@using (Html.BeginForm("Index", "Home", FormMethod.Get, new { name = "nbform", id = "nbform" }))
二、指定表单提交为数据方式code
@using (Html.BeginForm("ImportExcel", "Stock", FormMethod.Post, new { enctype = "multipart/form-data" }))
注意, 有时候要加{id=1}否则在点击超过第一页的索引时form后面会自动加上当前页的索引,若是此时再搜索则可能会出来“超出索引值”的错误提示
@using (Html.BeginForm("Index", null, new { id = 1 }, FormMethod.Get))orm
三、下面的操做能够防止提交连接后面自带参数blog
@using (Html.BeginForm("AddDIYBillOfLading", "BillOfLading", new { id ="" }, FormMethod.Post, new { name = "myform", id = "myform" }))
即,RouteValues的id=""索引