First add the Microsoft.AspNet.Identity.Owin namespace to web.config
<configuration> <namespaces> <add namespace="Microsoft.AspNet.Identity.Owin"/> </namespaces> </configuration>
then replace your code with:
<li> <a runat="server" href="~/Account/Manage" title="Manage your account"> Hello, <%: HttpContext.Current.GetOwinContext() .GetUserManager<YourNamespace.ApplicationUserManager>() .FindById(Context.User.Identity.GetUserId()).FirstName %>! </a> </li>
source share