Tuesday, September 18, 2012

Getting Current User Info in DotNetNuke

// DNN Get Current User


// The Current user information can fetch using UserController and
// is availble as UserInfo object:
 

 private UserInfo _currentUser =
                   DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();

// To get UserID of the current user we can then access the fetched UserInfo object:

 int UserID = _currentUser.UserID

Tuesday, September 04, 2012

DotNetNuke Error: System.Web.UI.UserControl' does not contain a definition for 'CreatedByUser'


Another tiring issue because of  automatic code generation of .designer.cs while building
DotNetNuke Module from asp.net User Control.

My asp.net user control was working flawlessly when I converted it in to DNN Module it was
not getting build. It was giving this error.

Error 16 'System.Web.UI.UserControl' does not contain a definition for 'CreatedByUser' and no extension method 'CreatedByUser' accepting a first argument of type 'System.Web.UI.UserControl' could be found (are you missing a using directive or an assembly reference?)


Solution:

I found the reason.. Apparently when a rename occurs the definitions are changed.
Originally the definitions where these:
protected global::DotNetNuke.UI.UserControls.LabelControl lblContent;
protected global::DotNetNuke.UI.UserControls.ModuleAuditControl ctlAudit;


After the renaming, they magically became these:
protected global::System.Web.UI.UserControl lblContent;
 protected global::System.Web.UI.UserControl ctlAudit;

As did every other control in the .designer.cs files!


Ref : http://www.dotnetnuke.com/Resources/Forums/forumid/199/threadid/355899/scope/posts.aspx


DNN Error - Could not create type 'DotNetNuke.Modules.Journal.ProfilePic


'Error 21 Could not create type 'DotNetNuke.Modules.Journal.ProfilePic''  
I was getting this error in when I was trying to compile latest DotNetNuke Community Edition CMS Version 06.02.0
This issue was appearing weird as the file contained no code. There was nothing could be done about it.
But finally it seems to build packaging problem from DNN Team. 

"You may safely delete this file." is what the DNN guys says. huh. thats a big relief ! !

>>Reply from DNN<<

There seems to be a file in the install package that shouldn't have been included. If you see a file named ProfilePic.ashx in the DesktopModules/Journal directory you can safely delete this file. This file was created before we moved to handler that was integrated with the core project.

Will Morgenweck
Director of Product Management
DotNetNuke Corp.