这是我观点的一部分:
<% using (Html.BeginForm())
{ %>
<input type="checkbox" name="ali" value="123" />
<%: Html.CheckBox("ali1") %>
<a href='<%:Url.Action("DeleteSelected", "Product", new { @ShopID = ViewBag.shopIDempty } ) %>'>dddd</a>
<input type="submit" onclick='<%: Url.Action("DeleteSelected", "Product", new { @ShopID = ViewBag.shopIDempty } ) %>' />
<%} %>
这是控制器:
public ActionResult DeleteSelected(FormCollection collection, int ShopID)
{
var t = collection.GetValue("ali");
var t2 = collection["ali"];
var selectCB11 = collection.GetValue("ali");
var t1 = collection.GetValue("ali1");
var t21 = collection["ali1"];
var selectCB121 = collection.GetValue("ali1");
//...
}
但是没有任何东西传递给我的变量,并且它们都始终为空。怎么了?