I have a next view:
<form class="actionButtons">
<input type="number" id="Quantity" name="Quantity" min="1" max="99" value="1" style="width:35px;"/>
@Html.ActionLink("+ Add to cart", "AddToCart", "Cart", new { productId = Model.ProductID, returnUrl = Request.Url.PathAndQuery }, null)
</form>
and action method:
public RedirectResult AddToCart(Cart cart,int productId, string returnUrl)
{
Product product = repository.Products.FirstOrDefault(p => p.ProductID == productId);
if (product != null) cart.AddItem(product, 1);
return Redirect(returnUrl);
}
How pass quantity value to this action method? Thanks