testapps/ContosoUniversityWeb/Pages/Students/Details.cshtml (56 lines of code) (raw):

@page @model ContosoUniversity.Pages.Students.DetailsModel @{ ViewData["Title"] = "Details"; } <h1>Details</h1> <div> <h4>Student</h4> <hr /> <dl class="row"> <dt class="col-sm-2"> @Html.DisplayNameFor(model => model.Student.LastName) </dt> <dd class="col-sm-10"> @Html.DisplayFor(model => model.Student.LastName) </dd> <dt class="col-sm-2"> @Html.DisplayNameFor(model => model.Student.FirstMidName) </dt> <dd class="col-sm-10"> @Html.DisplayFor(model => model.Student.FirstMidName) </dd> <dt class="col-sm-2"> @Html.DisplayNameFor(model => model.Student.EnrollmentDate) </dt> <dd class="col-sm-10"> @Html.DisplayFor(model => model.Student.EnrollmentDate) </dd> <dt class="col-sm-2"> @Html.DisplayNameFor(model => model.Student.Enrollments) </dt> <dd class="col-sm-10"> <table class="table"> <tr> <th>Course Title</th> <th>Grade</th> </tr> @foreach (var item in Model.Student.Enrollments) { <tr> <td> @Html.DisplayFor(modelItem => item.Course.Title) </td> <td> @Html.DisplayFor(modelItem => item.Grade) </td> </tr> } </table> </dd> </dl> </div> <div> <a asp-page="./Edit" asp-route-id="@Model.Student.ID">Edit</a> | <a asp-page="./Index">Back to List</a> </div>