Answer the question
In order to leave comments, you need to log in
How to display user data in Layout?
Good evening gentlemen. I've been struggling with this problem for some time now. The point is this. I'm not a pro in ASP, so I'm asking you. I can't get user data inside the Layout of the page.
Tried in different ways. For example, this method did not work
@using Microsoft.AspNetCore.Identity
@using KSM_Agro.Models
@inject SignInManager<User> SignInManager
@inject UserManager<User> UserManager
@{
var user = await UserManager.GetUserAsync(User);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question