Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  getting the user info...
Previous Previous
 
Next Next
New Post 2/21/2006 11:15 AM
User is offline Rob Morrow
23 posts
www.deviant-tuning.com
10th Ranked


getting the user info... 
i'm new to dotnetnuke module development and this whole data provider thing, so please be patient with me. :) i'm attempting to populate a dropdown with information from a database table which uses the userid to identify a record. i'm having issues with how to get the dnn userid. is it stored in session when the user signs in? any help would be greatly appreciated. thanks in advance.
 
New Post 2/21/2006 11:15 PM
User is offline Dave Buckner
94 posts
www.DaveBuckner.com
10th Ranked


Re: getting the user info... 

There is a property called UserInfo on the base class your module should be inherting.(DotNetNuke.Entities.Modules.PortalModuleBase). UserInfo has the details your after. So you could use (this|me).UserInfo.UserID, or if you don't need the extra details involved in the UserInfo object you could also use (this|me).UserId as well.

Forgive the C# below, if you need a vb version and C# is totally off the wall to you let me know and I will list that as well. Anyway, To load a userinfo up from an ID you have or have stored stored somewhere like the db =), you can get the details of them like so...

DotNetNuke.Entities.Users.UserController oUserController = new DotNetNuke.Entities.Users.UserController();

DotNetNuke.Entities.Users.UserInfo oUserInfo = oUserController.GetUser(this.PortalId, iSomeUserID);

oUserController = null;

//Set Some Label or textbox.Text of the username

txtSomeTxtBox.Text = oUserInfo.Username;

//Etc.

HTH's,

Dave

 
New Post 2/22/2006 7:40 AM
User is offline Rob Morrow
23 posts
www.deviant-tuning.com
10th Ranked


Re: getting the user info... 
this would be outstanding in vb. i hate to be a pest, but if you could post the vb code, i'd be in heaven.
 
New Post 2/22/2006 7:48 AM
User is offline Leigh Pointer
462 posts
www.subzero-solutions.net
8th Ranked










Re: getting the user info... 

This line will return you the Id of the currently logged in user:

   UserController.GetCurrentUserInfo.UserID


Leigh Pointer
User Group Champion [World Wide]
» Evangelising DotNetNuke Everywhere «

Dutch DotNetNuke User GroupSubzero SolutionsSoftware Developer Network
 
New Post 2/22/2006 11:18 AM
User is offline Rob Morrow
23 posts
www.deviant-tuning.com
10th Ranked


Re: getting the user info... 
this, i believe, works like a charm. thank you, much. for best practice purposes, i've put this into the moduleinfo.vb business layer file in the constructor section like follows...

Me.UserId = GetCurrentUserInfo.UserID
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  getting the user info...
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


XCESS expertise center b.v.
Custom made modules and complete solutions for the DNN framework. Maatwerk modules en complete webtoepassingen gebaseerd op het DNN framework.
www.xcess.nl
EMAS Pro
Strategic Enrollment Management Software for Higher Education Recruitment, Retention and Financial Aid
www.emaspro.com
Subzero Solutions
Dutch / English DotNetNuke consultancy services. Custom module development in any version. Complete application integration. Small business portal hosting. Your ideas our innovation - Your success our motivation. K.v.k Amsterdam: 34236342
www.subzero-solutions.net

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP