-1

I am using an MVC template and it had a standard page Roles with a button create, but when I click the button create it sends me to a login page where I cant log in. So I can't add roles which I need because I need an admin to see the other users's evaluations and the users can see their own evaluation on a page. How do I fix it?

The create.cshtml is this:

@model ASPNetMVCExtendingIdentity2Roles.Models.RoleViewModel
@{
ViewBag.Title = "Create";
}
<h2>Create Role</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()

<div class="form-horizontal">
    <h4>RolesViewModel</h4>
    <hr />
    @Html.ValidationSummary(true)

    @if (ViewBag.Message != "")
    {
        <p style="color: red">ViewBag.Message</p>
    }
    <div class="form-group">
        @Html.LabelFor(model => model.RoleName, new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.RoleName)
            @Html.ValidationMessageFor(model => model.RoleName)
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Description, new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
    </div>

    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <input type="submit" value="Create" class="btn btn-default" />
        </div>
    </div>
</div>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
Burst of Ice
  • 386
  • 2
  • 6
  • 23

1 Answers1

0

You need to get familiar how ASP.NET 5 Identity model works. Check here for details. Then check here to know how to create User role

Community
  • 1
  • 1
Hadee
  • 1,392
  • 1
  • 14
  • 25