Oct 16, 2015

ASP.NET MVC - How to hide or Show a link/button based on logged in User's Role permission?

For example, you can do it in a way like this:

@if (ViewContext.HttpContext.User.IsInRole("Your role"))
{
    // Do something here
}
 
 

No comments:

Post a Comment