Development

Show logged in users name in DotNetNuke

By March 30, 2008 No Comments

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

Web Application Startup Guide

A 30-page ebook that covers positioning, marketing, pricing, and building your startup product, plus more.

Leave a Reply