@model WebApplication1.Models.user @{ ViewBag.Title = "Edituser"; var allRoles = "addNews ,newsManagement, userManagment, tag&catManagment".Split(','); var Roles = Model.role.Split(','); }

Edituser

@using (Html.BeginForm()) { @Html.AntiForgeryToken()

user


@Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.HiddenFor(model => model.ID)
@Html.LabelFor(model => model.displayname, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.displayname, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.displayname, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.role, htmlAttributes: new { @class = "control-label col-md-2" })
@foreach (var r in Roles) { @r} @for (int i = 0; i < allRoles.Length; i++) { var r = allRoles[i];
} @Html.ValidationMessageFor(model => model.role, "", new { @class = "text-danger" })
}
@Html.ActionLink("Back to List", "Index")