Posted on March 30, 2008 22:03
DotNetNuke – Show the logged in users name
The DotNetNuke documentation does not always have everything you need to customize the system. Often times you need to open up DotNetNuke in Visual Studio to review some of the methods that are available to you in the skins / ascx controls.
Here is how to show the first name, last name or show the username of the logged in user in DotNetNuke / DNN.
<%If HttpContext.Current.User.Identity.IsAuthenticated=True Then%>
Welcome
<%=UserController.GetCurrentUserInfo().FirstName%>
,
<%End If%>
<% If HttpContext.Current.User.Identity.IsAuthenticated=False Then %>
| Sign Up
<% End If %>
<% If HttpContext.Current.User.Identity.IsAuthenticated=True Then %>
|
<% End If %>
To show the username of the logged in user in DotNetNuke you can use UserController.GetCurrentUserInfo().UserName
Read More »