我有一個使用Windows身份驗證的.Net 4網絡應用程序,所有的工作都很好,但是有一個微不足道的錯誤讓我瘋狂!從vb.net的LoggedInTemplate中剝離域名
Visual Studio中拼下顯示誰在
<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>
的問題是,雖然,這是顯示爲<domain>/user
而不僅僅是這我假設它是從
System.Threading.Thread.CurrentPrincipal.Identity.Name
但是我無法用編程方式來修改這個?
我喜歡Rob的實現/答案,但對於簡單的應用程序,這是我採取了你的建議。謝謝 – Dean 2011-02-28 09:48:02