我需要那个,我点击哪个项目,把它Id
付诸GetProduct()
行动。我使用hidden
了元素,但它不起作用:
@using (Ajax.BeginForm("GetProduct", "Product", new AjaxOptions { UpdateTargetId = "getProductResult" }, new { id = "productForm" }))
{
foreach (var item in list)
{
<a href="#" onclick="$('#productForm').trigger('submit');">@item.Name</a>
//this hidden always send '1', but I want to send item's Id
<input type="hidden" id='product_@(item.Id)' name ="id" value="@item.Id" />
}
<noscript>
<input type="submit" id="sendButton" />
</noscript>
}
我哪里错了?我该如何发送Id
?