Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Asp.net Identity - Showing the FirstName instead of username at loggedin users

$
0
0

Hi All,

just a quick question. Do you have any documentation to share or to point me to if I want to show to a logged-in user his or her name instead of his or her username?

I am using visual studio 2013 and using asp.net identity with webforms.

The default code looks like this:

<asp:LoginView runat="server" ViewStateMode="Disabled"><AnonymousTemplate><li class="signin"><a runat="server" href="~/account/login">SIGN IN</a></li> </AnonymousTemplate><LoggedInTemplate><li class="signedin"><a runat="server" href="~/account/manage"> Hi <%: Context.User.Identity.GetUserName()  %></a>             <ul class="mysubmenu"><li><a runat="server" href="~/account/manage">Manage your account</a>  <span class="triangle-container"><span class="triangle"></span></span></li><li><a href="#"><asp:LoginStatus runat="server" LogoutAction="Redirect" LogoutText="Logout" LogoutPageUrl="~/" OnLoggingOut="Unnamed_LoggingOut" /></a></li></ul>        </li>    </LoggedInTemplate></asp:LoginView>

Thanks


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>