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


2 comments:

Felipe Marciano said...
This comment has been removed by the author.
Felipe Marciano said...

Thanks for help.