Is there somthing in the dotnetnuke framework which will allow me to pass it a userId and it would return the UserInfo object filled with details of that userId.
If not what would be the normal way of doing this?
Try this (in DNN 5.x with C#)
private UserInfo _currentUser =
DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();
Then use the UserInfo later...
int UserID = _currentUser.UserID
I used the way posted by bdukes with one modification: PortalId can be get from PortalSettings:
DotNetNuke.Entities.Users.UserInfo user = DotNetNuke.Entities.Users.UserController.GetUser(PortalSettings.PortalId, user_id, true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With