Answer the question
In order to leave comments, you need to log in
How to filter content on a page based on the role of the logged in user in Razor pages in ASP.NET Core2.1?
I need to not show some blocks on the page, depending on the user's role. the official documentation only talks about access to the controller
Answer the question
In order to leave comments, you need to log in
@if(User.IsInRole("*RoleName*"){
<div class="just-in-role-seen"></div>
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question