1
As I pass this code that is on a page . Cs to a cshtml page.
ApplicationUser user = await UserManager.GetUserAsync(User);
This page is the layout, no Model and no DTO.
Thank you
1
As I pass this code that is on a page . Cs to a cshtml page.
ApplicationUser user = await UserManager.GetUserAsync(User);
This page is the layout, no Model and no DTO.
Thank you
0
I didn’t quite understand the question, but you can try using Viewdata to send data from a file . Cs to a . cshtml
Example . Cs:
public IActionResult Index(){ ViewData["Codigo"] = user; }
Example . cshtml:
<h1> @ViewData["Codigo"] </h1>
Browser other questions tagged asp.net-mvc asp.net-core
You are not signed in. Login or sign up in order to post.
Your page has a Model or DTO?
– Alexandre Cavaloti
@Alexandrecavaloti I advise you to read this answer Difference between DTO and Viewmodel?
– Barbetta
@Since, it depends a lot, I think it would be more feasible for you to indicate the problem you are having(why you want the
ApplicationUser
inView
), maybe the solution is different from the way you’re trying.– Barbetta