Books/Details.cshtml
Books/Index.cshtml
, the view Books/Details.cshtml
will be displayed as follows:
|
@model BookStore3.Models.Book @{ ViewData["Title"] = "Details"; } <h1>Details</h1> <div><h4>Book</h4><hr /> <dl class="row"> <dt class = "col-sm-2"> @Html.DisplayNameFor( model => model.Title ) </dt> <dd class = "col-sm-10"> @Html.DisplayFor( model => model.Title ) </dd> <dt class = "col-sm-2"> @Html.DisplayNameFor( model => model.Price ) </dt> <dd class = "col-sm-10"> @Html.DisplayFor( model => model.Price ) </dd> <dt class = "col-sm-2"> @Html.DisplayNameFor( model => model.PublishDate ) </dt> <dd class = "col-sm-10"> @Html.DisplayFor( model => model.PublishDate ) </dd> </dl> </div> <div> <a asp-action="Edit" asp-route-id="@Model?.Id">Edit</a> | <a asp-action="Index">Back to List</a> </div> |
“I just joined a gym. I don’t work out there, I just joined it. It’s nice to have something to cancel.” — Todd Barry |