Saturday, July 31, 2010
  Search
 
Register
Login
 
Getting Started with Code Endeavors Ajax Compiled Module Template
DotNetNuke Ajax development just got easy thanks to Jon Henning and his Ajax Compiled Module templates. He’s got them listed on CodePlex, they’re updated for DNN 5, and they are available in C# and V...

Find this article and more in the category

Read This Article . . .

Dude, Where’s my web.config file? Resolve Installation DNN Error Message: BC30451: Name 'Config' is not declared
Sometimes troubleshooting DNN errors can be a royal pain. Fortunately, if you know what you're looking for installation errors are usually pretty easy to resolve. Unfortunately, if you don't know wha...

Find this article and more in the category

Read This Article . . .

Creating new DotNetNuke HTTP Alias Records
 Setting up DotNetNuke to handle serving requests for Portal Alias records is a breeze. You can use these records to direct your site to handle requests for multiple domain names to one website with ...

Find this article and more in the category

Read This Article . . .

How to Use the DNNLabelEdit Control
 It's easy to use the DNNLabelEdit control, you know the one you mouse over and edit in place? Yeah, that one. In just a few minutes, you can begin using the control on your sites as well for full on...

Find this article and more in the Module Development category

Read This Article . . .

Getting Aquainted with the DNN Classes
 So, you've decided to start checking out DotNetNuke development and you're wondering where to start, right? Well, it's easy to start taking a quick tour of the DotNetNuke classes now with the help o...

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 . . .

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 . . .

How To Customize the Privacy and Terms Links on Your DotNetNuke Portal
Straight out of the box, DotNetNuke already has a lot of things covered. But, what do you do when you are ready to begin customizing your site. Sometimes, it’s not so easy to figure out how to make t...

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 . . .

Upgrading to DotNetNuke Cambrian 5.0 from DotNeNuke 4.x
If you're looking to try out the new DNN Cambrian package, you can upgrade previous DotNetNuke installations with the following steps. Remember, as of right now, the DNN 5.0 Cambrian package availabl...

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