Getting Started With ASP.NET Core 2.0 Identity And Role Management

In this article, we will see in detail how to use ASP.NET Core Identity in MVC Application for creating user roles and displaying the menu depending on user roles.

C# (2.1 MB)
5 Star
1,356 times
Add to favorites
E-mail Twitter Digg Facebook

Solution explorer

@model ShowRecoveryCodesViewModel
    ViewData["Title"] = "Recovery codes";

<div class="alert alert-warning" role="alert">
        <span class="glyphicon glyphicon-warning-sign"></span>
        <strong>Put these codes in a safe place.</strong>
        If you lose your device and don't have the recovery codes you will lose access to your account.
<div class="row">
    <div class="col-md-12">
        @for (var row = 0; row < Model.RecoveryCodes.Length; row += 2)
            <code>@Model.RecoveryCodes[row]</code><text>&nbsp;</text><code>@Model.RecoveryCodes[row + 1]</code><br />