I'm a novice to DNN programming, and I'm trying to write a couple custom controls. There are a couple of problems though. Any advice would be appreciated.
I have two custom controls... maincontrol2.ascx and maincontrol2.ascx . I have created two definitions for these and a key for B control.
The codebehind assigned to a button:
Response.Redirect(EditUrl("", "", "maincontrol2", ));
Yet, when I execute the button... I get:
DotNetNuke.Services.Exceptions.ModuleLoadException: Unable to cast object of type 'ASP.desktopmodules_webapplication1_maincontrol2_ascx' to type 'DotNetNuke.Entities.Modules.PortalModuleBase'. ---> System.InvalidCastException: Unable to cast object of type 'ASP.desktopmodules_webapplication1_maincontrol2_ascx' to type 'DotNetNuke.Entities.Modules.PortalModuleBase'. at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace --
What is the problem here? Thank you for your help. Also, what would be the best way to pass variables from one custom control to another? Is there a session variable I can declare and use?
TIA