This is the error i am getting
HttpContext doesn not contain a defination for Current
@if (HttpContext.Current.User.IsInRole("Administrator")) { Html.RenderPartial("AdminMenu"); }
IHttpContextAccessor need to be injected in the view page.
Refer below article.
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.