I am trying to develop a page, where the user is logged in, he is redirected to an index, where he would like to display the user name.
I'm using Identity
default of ASP.NET MVC
.
Then I thought about putting the following code in view
:
<!-- menu profile quick info -->
<div class="profile">
<div class="profile_pic">
<img src="~/images/img.jpg" alt="..." class="img-circle profile_img">
</div>
<div class="profile_info">
<span>Seja Bem vindo,</span>
<h2>@Html.LabelFor(m => m.User.Identity.Name)</h2>
@*<h2>John Doe</h2>*@
</div>
</div>
However, I'm having trouble using this Razor
.
- Is it correct to use
@Html.LabelFor
?
At the beginning of the page, I defined:
@model OneeWeb.Models.ApplicationUser
@{
ViewBag.Title = "Index";
}
- Is this the model responsible for having the user data?