I was trying to apply a container which was created using C# into a module. I'm using DNN 6.2.0. This is a web application which is been inherited by SkinObjectBase class.
Once the page is loaded, I'm getting the below error.
Could Not Load Container: /Portals/_default/Containers/Test/TestContainer.ascx DotNetNuke.Services.Exceptions.ModuleLoadException: Unhandled error loading module. ---> System.InvalidCastException: Unable to cast object of type 'ASP.portals__default_containers_test_testcontainer_ascx' to type 'DotNetNuke.UI.Containers.Container'. at DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc) at DotNetNuke.UI.Skins.Pane.LoadContainerByPath(String containerPath) --- End of inner exception stack trace ---
When I change the SkinObjectBase class to DotNetNuke.UI.Containers class, then it works fine. But inside the container, I was trying to get the module using DotNetNuke.UI.Containers.Container.GetPortalModuleBase(this); And since this is DNN 6.2.0, it says this method has been obsolete and try to use ModuleControl. But if I use that I cant get a PortalModuleBase object.
Can some one please help me on this. My basic questions are:
1. When implementing a container, using C# is it correct to inherit it from the DotNetNuke.UI.Containers class?
2. How can I access the PortalModuleBase object inside a container.
Thanks in advance.