8.2.2 Adding the Add to Cart Buttons; Listing 8-13. Adding the Buttons to the ProductSummary.cshtml File View
parent
697f6017dd
commit
905ecd6969
|
@ -5,5 +5,14 @@
|
|||
<strong>@Model.Name</strong>
|
||||
<span class="pull-right label label-primary">@Model.Price.ToString("c")</span>
|
||||
</h3>
|
||||
|
||||
@using (Html.BeginForm("AddToCart", "Cart"))
|
||||
{
|
||||
<div class="pull-right">
|
||||
@Html.HiddenFor(x => x.ProductID)
|
||||
@Html.Hidden("returnUrl", Request.Url.PathAndQuery)
|
||||
<input type="submit" class="btn btn-success" value="Add to cart" />
|
||||
</div>
|
||||
}
|
||||
<span class="lead">@Model.Description</span>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue