DNN2: Create a custom DotNetNuke Module in 12 steps


Looking for DNN4 stuff??? Check my more recent posts:
   *
DNN4.02: Create Your DotNetNuke Development Environment
   * DNN4.02: Quick & Dirty C# and VB Custom Modules
   * DNN4.02: Starting New DotNetNuke Modules in C# or VB.Net


The practice of creating custom DNN modules is documented in many places, but I have yet to see a small, concise list of items to just get the job done.  Here's my list, and it's concise because it assumes you have already set up your test environment, you are using and are familiar with VS 2003, and you are familiar with DotNetNuke's File Manager.

1. Add new "Empty Web Project" to DotNetNuke solution under DotNetNuke\desktopmodules, name it appropriately
2. Rename project to [company].DNN.Modules.[modulename]
3. Under References, add "DotNetNuke" from the projects tab
4. Add reference in DnnFramework project to your new module's project
5. Add text file, name it [modulename].dnn, and fill in Private Assembly info (.dnn file information here)
6. In project properties, rename assembly to [company].DNN.Modules.[modulename]
7. Add main user control (be sure to include the ascx & assembly files in the DNN file!)
8. Update control to inherit from DotNetNuke.PortalModuleControl, instead of System.Web.UI.UserControl
9. Add using statement for DotNetNuke namespace
10. Set CSS for text controls to DNN styles:
     Titles: Head
     Linkbuttons: CommandButton
     Validators: NormalRed
     Form Prompts: SubHead
     Text: Normal
11. In DotNetNuke web, add a Module definition to the ascx just created, add module to a test tab.  For the initial 'View'-type  control, leave 'Key' and 'Title' fields blank, and set type to 'View'.  Test that it displays properly.
     (Now, simply compiling the project will update the module!)
12. To package module, zip the assembly(s), ascx controls, resource files, dnn file, style sheets, and a readme.txt file that documents the module
     Note: Be sure to compile your assembly in Release mode & not Debug!

There you have it!  You can now set a breakpoint and step through your module.  The assembly should be getting placed into both the dotnetnuke\bin folder, and the module's \bin folder.  You know what it takes to create a single-page DNN Private Assembly without any data access.

Next: Add Actions to your module's options menu!

Print | posted on Tuesday, October 12, 2004 4:49 PM

Feedback

# re: DNN: Create a custom DotNetNuke Module in 12 steps

left by Richard at 12/17/2004 11:16 AM Gravatar
Very Nice... not to much in the way of custom module design I have found so far. Thank you for compiling the information.

# re: DNN: Create a custom DotNetNuke Module in 12 steps

left by bJen at 4/28/2005 3:27 PM Gravatar
Great I have been looking for simple directions (without all the fluf) for about a week now this worked great. I am on my way thank you.
Title  
Name
Email (never displayed)
Url
Comments   
Please add 1 and 3 and type the answer here: