I am writing an HTMLHelper but I need to access User.Identity.Name, how do I do that?
public static string YourHtmlHelper(this HtmlHelper html)
{
var name = html.ViewContext.HttpContext.User.Identity.Name;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With