Wednesday, August 27, 2008
        Register
   
Tehnical Publication

Current Articles | Categories | Search | Syndication

Dynamic Load User Controls in DotNetNuke

 Code walk thru:

SwitchBoard.ascx - This is the View page, in which line 2 is a placeholder

SwitchBoard.ascx.vb - This is the code behind of SwitchBoard.ascx.  Line 86 is used for loading different user control by calling the Control_Load() routine.  The Control_Load code is in line 21 to 44.  In this example, one of the 2 user controls could be loaded.  Line 14 has the default control to be loaded.  Notice that the Control_Load routine is placed in the Page_Init, not in Page_Load event.

Utility.vb - This is used to dynamically build the URL of the module.

Sample project is available for download at the bottom of this page.  Demo is on the left pane.  In this demo, the main View page (SwitchBoard.ascx) loads one of the three controls in the sub-folder Folder1, Folder2 and Folder 3.

Picture below has a screen shot of where files resided in the the project.

multipleview.gif

posted @ Thursday, November 15, 2007 10:46 AM by Fuji (mcsenow) Nguyen

Previous Page | Next Page

COMMENTS

Currently, there are no comments. Be the first to post one!
Click here to post a comment

Support Links

Community Projects

Privacy Statement  |  Terms Of Use Copyright 2000-2008 InDyne Commercial Products Corporation