I am developing MVC 4 application in which I need to pass the updated value from the view to controller.
@foreach (var item in Model)
{
<tr>
<td>@item.ProductId</td>
<td>@item.Product.ProductName</td>
<td>@item.Product.UnitPrice</td>
<td>
@Html.TextBox("QuantityBox", item.Quantity)
</td>
</tr>
}
//Update Button
@using (Html.BeginForm("UpdateCart", "Cart", FormMethod.Post))
{
@Html.AntiForgeryToken()
<input type="submit" id="submit" name="Update" value="Update" />
}
The values could be entered different for different rows. I need to pass these values from quantity textbox to controller.