8.1.3.3 Creating the View; Listing 8-8 The Contents of the Menu.cshtml File

This commit is contained in:
Jason Zhu 2021-09-08 23:08:58 +10:00
parent c55dd5f133
commit 4eaf23bc64
2 changed files with 20 additions and 1 deletions

View File

@ -149,6 +149,7 @@
<Content Include="Views\Product\List.cshtml" />
<Content Include="Scripts\jquery-1.9.0.min.map" />
<Content Include="Views\Shared\ProductSummary.cshtml" />
<Content Include="Views\Nav\Menu.cshtml" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
@ -158,7 +159,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Views\Nav\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SportsStore.Domain\SportsStore.Domain.csproj">

View File

@ -0,0 +1,19 @@
@using System.ServiceModel.Syndication
@model IEnumerable<string>
@Html.ActionLink("Home", "List", "Product", null,
new { @class = "btn btn-block btn-default btn-lg" })
@foreach (var link in Model)
{
@Html.RouteLink(link, new
{
controller = "Product",
action = "List",
category = link,
page = 1
}, new
{
@class = "btn btn-block btn-default btn-lg"
})
}