@model ContosoUniversity.Models.Instructor @{ ViewBag.Title = "Edit"; }

Edit

@using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true)
Instructor @Html.HiddenFor(model => model.InstructorID)
@Html.LabelFor(model => model.LastName)
@Html.EditorFor(model => model.LastName) @Html.ValidationMessageFor(model => model.LastName)
@Html.LabelFor(model => model.FirstMidName)
@Html.EditorFor(model => model.FirstMidName) @Html.ValidationMessageFor(model => model.FirstMidName)
@Html.LabelFor(model => model.HireDate)
@Html.EditorFor(model => model.HireDate) @Html.ValidationMessageFor(model => model.HireDate)
@Html.LabelFor(model => model.OfficeAssignment.Location)
@Html.EditorFor(model => model.OfficeAssignment.Location) @Html.ValidationMessageFor(model => model.OfficeAssignment.Location)
@{ int cnt = 0; List courses = ViewBag.Courses; foreach (var course in courses) { if (cnt++ % 3 == 0) { @: } @: } @: }
@course.CourseID @: @course.Title @:

}
@Html.ActionLink("Back to List", "Index")
@section Scripts { @Scripts.Render("~/bundles/jqueryval") }