This is the error i am getting
HttpContext doesn not contain a defination for Current
@if (HttpContext.Current.User.IsInRole("Administrator"))
{
Html.RenderPartial("AdminMenu");
}
Download FREE API for Word, Excel and PDF in ASP.Net:
Download
dharmendr
on Oct 07, 2022 04:47 AM
on Oct 07, 2022 05:09 AM
7
IHttpContextAccessor need to be injected in the view page.
Refer below article.