7.6.3 Creating a Partial View; Listing 7-29 Using a Partial View in the List.cshtml File

chap07
Jason Zhu 2021-09-08 17:07:12 +10:00
parent bc939b22da
commit 5b843e3cdb
1 changed files with 2 additions and 8 deletions

View File

@ -7,15 +7,9 @@
@foreach (var p in Model.Products) @foreach (var p in Model.Products)
{ {
<div class="well"> @Html.Partial("ProductSummary", p)
<h3>
<strong>@p.Name</strong>
<span class="pull-right label label-primary">@p.Price.ToString("c")</span>
</h3>
<span class="lead">@p.Description</span>
</div>
} }
<div> <div class="pager">
@Html.PageLinks(Model.PagingInfo, x => Url.Action("List", new { page = x})) @Html.PageLinks(Model.PagingInfo, x => Url.Action("List", new { page = x}))
</div> </div>