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.ascxDotNetNuke.Services.Exceptions.ModuleLoadException: Unhandled error loadingmodule. ---> System.InvalidCastException: Unable to cast object of type'ASP.portals__default_containers_test_testcontainer_ascx' to type'DotNetNuke.UI.Containers.Container'. atDotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl,String ControlSrc) at DotNetNuke.UI.Skins.Pane.LoadContainerByPath(StringcontainerPath) --- 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 moduleusing DotNetNuke.UI.Containers.Container.GetPortalModuleBase(this); And sincethis is DNN 6.2.0, it says this method has been obsolete and try to useModuleControl. 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 fromthe DotNetNuke.UI.Containers class?
2. How can I access the PortalModuleBase object inside a container to get the module title from the container?