Last post Jun 02, 2005 04:40 AM by Dingy
Apr 15, 2005 02:15 PM|dawoe|LINK
Apr 16, 2005 02:44 PM|dantindall|LINK
Response.Redirect(NavigateURL & “mid=” & ModuleID & “&ctl=ControlKey”)
The preceding code block would have the effect of loading the current module, but with the specific control specified by passing its key name value via the CTL parameter. See the
section on DNN user controls for more information on how controls work with your modules."
I was having this same problem on an earlier project, and this solution worked for me in the end.
Give it a try.
Apr 17, 2005 08:32 AM|amoywolf|LINK
dantindall, your solutions is still in admin mode, right? But my understanding is, dawoe wants the control module displayed in normal mode, meaning that other modules in other panes are disployed in ther same tab as well.
Apr 17, 2005 02:29 PM|dantindall|LINK
Apr 17, 2005 02:55 PM|rodneyjoyce|LINK
Apr 17, 2005 03:31 PM|dantindall|LINK
Apr 17, 2005 09:14 PM|rodneyjoyce|LINK
Apr 19, 2005 10:06 PM|kpetro|LINK
This is what I did to acheive something similiar to what you are asking. It may have been overkill, but it was something I had already coded and I used it as a learning experience for creating a DNN Module.
My custom DNN Module's Edit Control and View Control work as follows:
Edit Control: The edit control is used to enter in mappings between controlstates and controlclasses. The control class is jsut a path to a normal ascx file (which are now converted to inherit PortalModuleBase).
View Control: The view control basically reads the control state from the query string and then loads the appropriate usercontrol to display. It only consists of a placeholder control. The Page_Load reads the controlstate, loads the appropriate
control, and then adds that control to the placeholder. Therefore I can add one module to my contentpane and load controls dynamically based off the state in the query string.
As said before I had an existing site with many stock user controls and a similiar notion of a skin, where I had one placeholder (ContentPane) reading the state and loading the control. I didn't want to recode all these control's as individual modules so this
is how I decided to implement.
Jun 02, 2005 04:40 AM|mcsenow|LINK
Code to have a single page as a switch board to load other controls
Jun 07, 2005 03:05 PM|dantindall|LINK
Maybe I'm just not getting it, but I have attempted to implement this and keep getting an error:
Object reference not set to an instance of an object
The error line is in the following snip of code
Dim objModule as Entities.Modules.PortalModuleBase = CType(Me.LoadControl(_DefaultPage), DotNetNuke.Entities.Modules.PortalModuleBase)
If Not objModule is Nothing Then
objModule.ModuleConfiguration = Me.ModuleConfiguration
plhContent.Controls.Add(objModule) ----This is the line that is throwing the error.
Do you have a complete example that you can post that includes your Main Viewer page, Code behind, as well as a user control that is loaded by the Main Viewer?
Or do you have any reason why this would be throwing this error?
Jun 07, 2005 06:40 PM|mcsenow|LINK
Make sure you have a control name <asp:PlaceHolder id="plhContent" runat="server"></asp:PlaceHolder> on the Main Viewer page.
Jun 08, 2005 12:09 AM|dantindall|LINK
Jun 08, 2005 10:21 PM|mcsenow|LINK
Jun 09, 2005 02:18 AM|dantindall|LINK
Jun 10, 2005 03:00 AM|mcsenow|LINK
Jun 10, 2005 05:29 AM|Nocturnal|LINK
Jun 10, 2005 10:42 PM|Dingy|LINK