Saturday, July 31, 2010
  Search
 
Register
Login
 
How to Install and Configure ActiveDirectory Provider for DotNetNuke 5.0
 The directions for installing and configuring extensions in DotNetNuke 5.0 are very similiar, but slightly different than from previous versions. Here's how to install the ActiveDirectory authentica...

Find this article and more in the category

Read This Article . . .

Quick Look at Some New Features of DotNetNuke 5 Cambrian
DotNetNuke’s much anticipated Cambrian has finally been made available as a Release Candidate and while it looks like the same ol’ packages from afar, it’s packed with some nice new features that are...

Find this article and more in the category

Read This Article . . .

I Need to Modify the What to Install DNN? What in the World is a Web.Config File Anyway??
 If you're wondering what in the world a web.config file is, then wonder know more. . .in about 5 minutes, you'll know more than you do now and be well on your way to moving forward.

Find this article and more in the Web.Config category

Read This Article . . .

New "Styles" SkinObject Found in DotNetNuke 4.9
One more addition has been added to the developer's DotNetNuke skinning toolbox with the release of DotNetNuke 4.9. Introducing...the Styles SkinObject. This little object is a very welcome addition ...

Find this article and more in the DotNetNuke category

Read This Article . . .

Everything You Never Wanted to Know About the Config File
This is the "pre-" first installment in a series that will cover the parts of the web.config file to give you an idea of how to manipulate and customize your DotNetNuke portal. The web.config fi...

Find this article and more in the category

Read This Article . . .

Quick Check for Troubleshooting the CodeEndeavor Ajax Templates
I haven’t just installed the the template and created a module out of the box yet. However, I have come across a few things that I know to check and fix and I’m up and running in no time at all. If y...

Find this article and more in the category

Read This Article . . .

Quick Check for Troubleshooting the CodeEndeavor Ajax Templates
I haven’t just installed the the template and created a module out of the box yet. However, I have come across a few things that I know to check and fix and I’m up and running in no time at all. If y...

Find this article and more in the category

Read This Article . . .

More Ways to Install DotNetNuke Modules with the URL Method
While DotNetNuke has a built in mechanism for installing modules, there is another method you can use as well. This is a great alternative to use especially when you are trying to install larger mod...

Find this article and more in the category

Read This Article . . .

Simple Intro to the DNN UserInfo Class
 New DNN developers often wonder how to expose information about logged in users to a custom DotNetNuke module. So, I threw together a very simple example to show how easy it is to begin using the bu...

Find this article and more in the DotNetNuke category

Read This Article . . .

Setting Up the DotNetNuke Side of Multi-Websites
Ok, so by now you know that DotNetNuke can handle multiple websites, but you still want to know why. Well, it’s pretty easy once you know how to do it, but it can be pretty confusing to some who are ...

Find this article and more in the category

Read This Article . . .

Recently Added Articles

Minimize
Article List

 

Simple Intro to the DNN UserInfo Class

10/23/2008 2:20:23 AM - By Briana Tarrance

Category: DotNetNuke | | Comments 0

 

 

Related Links

New DNN developers often wonder how to expose information about logged in users to a custom DotNetNuke module. So, I threw together a very simple example to show how easy it is to begin using the built in user information features found in DotNetNuke.

First, I created a simple user control with nothing but a label on it:

<asp:Label ID="Label1" runat="server" Style="position: relative" Text="Label"/>

Then, on the codebehind, I added the following:

Imports DotNetNuke
ImportsDotNetNuke.Entities.Users
Imports System.Web.UI
 
Namespace Template
 
Partial Class UsersStuff
   Inherits Entities.Modules.PortalModuleBase
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Try
        If Not Page.IsPostBack Then
            'Hide update buttons from users not assigned to particular security groups
            If Not PortalSecurity.IsInRole("Registered Users") Then
                Label1.Text = "You must be registered to see this message"
            Else
                 Dim uInfo As UserInfo = UserController.GetCurrentUserInfo()
                 Label1.Text = "Hi, " & uInfo.DisplayName & " & _Is this still a valid address?  " & uInfo.EmailuInfo." and watch to see what methods the intellisense brings up to you for more user infomration.
                    "
    
           'type "
           End If
        End If
     
   
       Catch ex As Exception
          ProcessPageLoadException(ex)
       End Try
 
    End Sub
  
End Class
 
End Namespace

Finally, I dropped the module on a test page and here is a picture of the output:

 

 

 

 

 

And, that's how easy it is to get started with the UserInfo classes. DotNetNuke makes it easy to personalize your user experience

 


 
 
Copyright 2008 by Virtual-Essentials.com Privacy Statement    Terms Of Use