Answers for "hiding links from certain roles"

0

hiding links from certain roles

@Html.ActionLink("Index", "Home") 
@Html.ActionLink("About", "Home") 
@Html.ActionLink("Contact", "Home") 
@if ( User.Identity.IsAuthenticated ){
    if ( User.IsInRole("Admin") ){
        @Html.ActionLink("Admin", "AdminController")        
    }
}
Posted by: Guest on April-15-2020

Browse Popular Code Answers by Language