خرید بک لینک

Vote count: -1

I need to know how I can do a module of roles and users, I read about asp.net identity but I don't understand anything, I want to create a web app with my own data base and implements a role module. I try saving a user's rol in a session variable and in the controller I ask using an if like this :

If(Session["Rol"] == "admin"){
 // do something
}
else
    retu RedirectToAction("xxx","xxx");

and in the view:

@if (Session["Rol"] == "admin"){
 <label>Admin</label>
}

But I don't know if this can be right. Can you tell me if exist other way (identity and how I can uses it or other thing) or if can I use the session variable for this.

Sorry for the bad English. Thank you!.

asked 32 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 20 فروردين 1395 ساعت: 5:11

صفحه بندی