I have a .Net 4 web app that uses Windows authentication and all works well however there is one trivial bug that is driving me nuts!
Visual Studio puts together the following for displaying who is logged in
<LoggedInTemplate>
Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
[ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="http://somewhere/default.aspx"/> ]
</LoggedInTemplate>
The problem is though that this is displaying as <domain>/user rather than just the username which I am assuming it is pulling this value from
System.Threading.Thread.CurrentPrincipal.Identity.Name
However I can’t see anyway programtically to amend this?
An easy fix to it is to use a label in a place of the loginname control in your template. You can strip the domain from the User.Identity.Name and put the stripped version in a label. I had this problem too and I used the label (at least this is what I recall)