Creating an admin page in asp.net mvc 5

I started with the main tutorial http://www.asp.net/mvc/tutorials/mvc-5/introduction/getting-started .

I added 2 roles to the AspNetRoles database table (yes, the database is also generated automatically)

Now I am looking for tutorials to create an admin page. because I don’t know where to start. Can any of you put me in the right direction.

+4
source share
2 answers

You can start by adding AdminControllerand then give it a few Actions.

[Authorize] , , - :

[Authorize(Roles = "Admin, AnotherRole")]
public class AdminController : Controller
{
    public ActionResult Index()
    {
        return View();
    }
}
+4

, , "", , , , , actionExult.... , ... [ (Roles = "admin" )] actionresult.... admin ... , . . 4:

+2

Source: https://habr.com/ru/post/1535027/


All Articles