Access User.Identity.Name in HTMLHelper class
asp.net-mvc
Solution
public static string YourHtmlHelper(this HtmlHelper html)
{
var name = html.ViewContext.HttpContext.User.Identity.Name;
}
Problem
I am writing an HTMLHelper but I need to access User.Identity.Name, how do I do that?