@model ValidationWebSite.Models.Person @{ object areaObject; ViewContext.ActionDescriptor.RouteValueDefaults.TryGetValue("area", out areaObject); var areaName = (areaObject as string) ?? "root"; ViewBag.Title = "Create in " + areaName + " area."; }

@ViewBag.Title

@using (Html.BeginForm()) {

Person


@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.Id, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.Id, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Id, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.UserId1, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.UserId1, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.UserId1, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.UserId2, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.UserId2, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.UserId2, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.UserId3, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.UserId3, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.UserId3, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.UserId4, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.UserId4, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.UserId4, "", new { @class = "text-danger" })
}
@Html.ActionLink("Go back to home", "Details")
@section Scripts { @* Until script helpers are available, add script references manually. *@ @* @Scripts.Render("~/bundles/jqueryval") *@ }