11.1.4.2 Creating the Edit View; Listing 11-6 The Contents of the Edit.cshtml File

This commit is contained in:
Jason Zhu 2021-09-23 12:48:39 +10:00
parent 35c520e1ed
commit f1cdbf375b
2 changed files with 19 additions and 0 deletions

View File

@ -161,6 +161,7 @@
<Content Include="Views\Cart\Completed.cshtml" />
<Content Include="Views\Shared\_AdminLayout.cshtml" />
<Content Include="Views\Admin\Index.cshtml" />
<Content Include="Views\Admin\Edit.cshtml" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>

View File

@ -0,0 +1,18 @@
@model SportsStore.Domain.Entities.Product
@{
ViewBag.Title = "Edit";
Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<h1>Edit @Model.Name</h1>
@using (Html.BeginForm())
{
@Html.EditorForModel()
<input type="submit" value="Save" />
@Html.ActionLink("Cancel and return to List", "List")
}
<h2>Edit</h2>