Subscribe: CMS
Added By: Feedage Forager Feedage Grade B rated
Language: English
add  control  create  custom modules  custom  dnn  dotnetnuke  file  folder  module  modules  new  project  update  web 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: CMS



Copyright: Gerry Heidenreich

DNN4.02: Quick & Dirty C# and VB Custom Modules

Tue, 21 Feb 2006 03:08:00 GMT

DisclaimerThe point of this post is to help people understand that DNN Module development can be as simple as creating an ASP.Net User Control.  There are many benefits to minding the guidelines (which at first seem complex), but in reality, the requirements met by these guidelines are a little extreme for hobbyists & smaller projects.  I still recommend that you use the best practices and guidelines specified in DNN Custom Modules documentation (“DotNetNuke Module Developers Guide.pdf” inside the documentation package on  Learning & minding the guidelines will:   * prepare your module for easy deployment   * remove database dependencies   * enable localization   * allow importing & exporting of information between modules   * provide context-based actions   * personalize the UI   * exploit the DNN Scheduler for automating processes   * result in cleaner, properly separated code layers for extensibility. Also, I highly recommend Daniel Egan's book “Building Websites with VB.Net and DotNetNuke 3.0”, and keep an eye out for the upcoming 2nd edition of this book. ;) As the title says, this is quick & dirty... for a guide through using the DotNetNuke Templates in your IDE & setting up a good, not-so-quick but clean module with best practices in mind, check out my Starting New Modules post here. OverviewLooking through Bil Simser's “DotNetNuke vs. SharePoint“ post, I realized that there is some hesitation about custom development in DNN.  As Shaun Walker mentions lower in the comments of that post,  the guides you read online and in in books typically follow pretty strict enterprise standards.  Though it's recommended, it's not necessary... Creating a custom module is as simple as making an ASP.Net User Control.  You will use DotNetNuke's Module Definitions page to add the Module to your DNN environment.  Once this is complete, you can add instances of your module anywhere within the site, and debug from within your DotNetNuke solution.  The demo in this post will result in a simple module that displays the ModuleId in a label. Get DNN Going on your dev boxI recommend installing DotNetNuke's full source package (solution) if you're doing any custom dnn development.  It's free, easy to install, and gives you the opportunity to debug your module, and when you need it, the dnn environment.  You can have a local DNN solution installed and ready to go in about 10 minutes.  My post to quickly guide you through this is here: DNN4.02: Create Your DotNetNuke Development Environment. Create the Module   * Open your DotNetNuke solution   * Add a folder to the DesktopModules folder of your DotNetNuke project, ex: “ShowModuleId”   * Add a new User Control (any language) to the ShowModuleId folder, ex: "ShowModuleId.ascx"   * Update User Control to inherit from DotNetNuke.Entities.Modules.PortalModuleBase   * Drop a label onto the form, inside Page_Load set label text to ModuleId.ToString()   * Compile Install Module   * Open DotNetNuke web, log in as host   * Navigate to Host > Module Definitions   * Mouse-over the context-menu of the Module Definitions module, select “Add New Module Definition”, set the fields as follows:       - Name: uniquely identifies module in the system, ex: ShowModuleId       - Folder Name: the name you placed your .ascx into, this is used later, type it in right, ex: ShowModuleId       - Friendly Name: the name the module is displayed as in the module admin dialogs       - click Update   * Definition fields display below, type in a definition name in New Definition, ex: ShowModuleId,[...]

DNN4.02: Starting New DotNetNuke Modules in C# or VB.Net

Sun, 12 Feb 2006 22:55:00 GMT

C#?There's a misconception that DNN development is done in VB only.  It's true that the DNN core is written in VB, but DotNetNuke is extended through the development of modules.  Modules can be written in any .Net language, as long as they inherit from DotNetNuke.Entities.Modules.PortalModuleBase. No more Private AssembliesPrivate assemblies were used to decouple custom modules from the DNN core.  New modules were developed in separate projects from DotNetNuke, and required a 'builder' project to assure the correct .dll's were being deployed to the correct \bin. My earlier DNN2 posts detailed the work required to hack up a good debugging DNN environment.  The new method of development and deployment takes advantage of ASP.Net's dynamic runtime compilation/code sharing features by placing source code inside the App_Code folder.  Module interface & resource files are still inside of the \DesktopModules\[ModuleName] folder.  Deployment now involves copying all the required (desktopmodule & app_code) files out and zipping them up with the [ModuleName].dnn manifest file.  For commercial module deployment (without the source), you need VS2005 Standard or better (VWD won't pre-compile your code), and you need to pre-compile your applicationTemplates   Install the Starter Kit for your VWD or VS2005 environment.            Download from downloads section (must register first).          The Starter Kit installs templates for C# & VB modules. Add New Module   1. Add Item          Select the web project (if you are opening the Source package, there will be many projects)          Ctrl+N (or File > New > File) to Add Item          Scroll down and select “DotNetNuke Module”             If you do not see this item, you either don't have the Starter Kit installed, or you didn't have the web project selected before this step.          Name your module - example, 'Test1' & Select your language, click 'Add'.             Note: View 'What did the template do?' below to see what just happened...   2. Update project folders - 2 folders were just created, and filled with the files needed for a new module.          Rename the folders 'ModuleName' to the name of your new Module in the following directories:             \App_Code             \DesktopModules   3. Update codeSubDirectories in web.config(not necessary for VB.Net Modules)          For ASP.Net 2 'runtime compilation' support, source code is kept in subdirectories within the App_Code folder.          Open web.config, for module named 'Test1', go to          , add the following element:                4. Install Both Module Definitions into DNN - 2 of the sql scripts created by the template must be executed within DNN.            Open DNN in your browser          Log in as host - default is login: host, pass: host          Go to SQL Page - In the nav, select Host[...]

DNN4.02: Create Your DotNetNuke Development Environment

Sun, 12 Feb 2006 21:04:00 GMT

Download Packages (I recommend Docs, Source, & Starter Kit)Start by registering at  Once you're registered & signed in, go to the Download section, you'll see 4 packages:   1. Docs - Definitely good to have around   2. Install - Completely non-source release for deployment only.  I highly recommend getting the Source package for development.   3. Source - Everything but the kitchen sink   4. Starter Kit - A must-have package, installs .Net 2 templates (compatible with VS2005 & Visual Web Developer 2005)          * New DNN Application Template - create new DNN sites straight from VS          * New Module (VB, & C#) - Creates View/Edit controls, SQL integration, Module Manifest (.dnn file), and other items needed for writing your own module          * New Skin - generates files necessary for a new skin InstallationNote: Don't browse to site or open the DNN solution until the following 5 steps are completed   1. Unzip DNN - Extract your dnn package into your web folder, example: c:\inetpub\dnn402          If you're unzipping the Install Package, there will be 2 directories created below: Library, and Website   2. Create IIS Virtal Directory - Point at the dnn root folder, be sure to go to the ASP.NET tab of your Virtual Directory and change the version from 1.1 to .Net 2.  example: c:\inetpub\dnn402\website, Virtual Directory “dnn402” will be found at http://localhost/dnn402, but do not browse there yet.   3. Database - Create your dnn database (example, dnn402dev, add a database user & assign as owner (db_owner in SQL).  (Owner privs aren't necessary, DNN Installation documentation details minimum requirements for permissions).   4. web.config - Copy release.config from the dnn root to web.config.  Update the db connection strings (there's 2, one is for legacy support), SQL settings are at:          , and          ...          sample connection string: Server=(local);Database=dnn402;uid=dnnuser;pwd=dnnuser;   5. IIS worker process permissions - Make sure your worker process user account has read/write privileges to directories & files under your dnn directory (again, minimal requirements are detailed in the DNN Installation Documentation) - Default worker process accounts are:          IIS5 & Win2000: {ServerName}\ASPNET          IIS6 & Win2003: NETWORK SERVICE Browse to site to conclude install process   Opening the site in your browser (example, http://localhost/dnn402) executes all the scripts necessary to create the portal environment.   Once this is complete, you will see the Home page with a few default modules installed. Back it up   Now is the time, db & app directory! Opening the Solution   First, update the path of the web project inside the .sln file!  The default inside DotNetNuke.sln is DotNetNuke_2.     The current 4.02 build fails to compile!  Open the solution and build a few times until all the dependent projects are built & the solution builds fine. Final Note   This post covers the simplest way to get a dev DNN environment going on your local machine.  There are many options in the install process that are covered in detail in the document 'D[...]

Preparing Before Talk, Killola

Fri, 27 Jan 2006 04:25:00 GMT

I'll be kicking off my speaking career in June.  I'll be discussing DotNetNuke 4, and custom module development (to correspond with another project on the hitlist), to the WI .Net UG.  Though I've been anxious to start the whole speaking-thing off with a bang, I didn't exactly consider it in a literal sense.
I was pointed at an interesting article on BBC News (thanks for the pointer, Marty).

Of course... I still intend to prepare using the traditional methods.

I was in CA this weekend, at the SoCal Code Camp (which was a riot, post is coming soon)... we enjoyed the 1st official 'Rock & Roll Geek Dinner'.  The entire weekend was organized by my friend Daniel Egan, the DotNetDoc, and entertainment was organized by none other than 'that Indigo Girl', Michelle Leroux Bustamante.

Killola got up and played all of their music from their CD, track for track... and they rocked.  Loaded with, sexy & energetic punkish, original heavy rock, they kept the geeks happy for almost an hour.  Check out their site (and their myspace), buy their music, and beg them to come give us company in Milwaukee on April 21st (hint, hint!)...

I have to thank Daniel & Michelle for their hard work in organizing this thing, it made for an absolutely unforgettable weekend.  I'm inspired to give our upcoming events whatever kick in the pants (short of sponsoring the thing) that I can to make it as good as this!


John Mitchell is blogging

Thu, 08 Sep 2005 14:56:00 GMT

John has finally given in to the temptations of DasBlog and started a blog of his own.  Stick with him to hear about his latest DotNetNuke escapades and announcements.

[John Mitchell's Weblog]


Installing DotNetNuke 3

Tue, 15 Mar 2005 03:59:00 GMT

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 UPDATE: I'm getting tons of hits on this from Google, as it turns out, this one of the most authoritative posts on installing DNN3.  That's great to hear, but I threw this together for myself to use later, I know it's not as good as it could be. PLEASE PROVIDE INPUTAny details I may have missed, better verbage, etc... Please post any new updates to DNN3 that change process below so I can keep it up to date... I'll be watching, thanks! - Gerry DotNetNuke 3 has been in the blender for months now, and I've passed up a dozen (almost) chances to play with betas, but real life has kept me from seeing what Shaun Walker et. al. have brought our way. Well... it's finally out, so I decided to dive in and check it out myself. For those of you (like myself) that would rather muddle around with the source instead of using the good old rtfm method to get it to install correctly, here are some pointers.  For reference, I've installed it to my test folder dnn3, mapped to http://localhost/dnn3. Update June 28, regarding the v3.1.0 release: There is now a selection of .config files, no web.config comes out of the box!  You need to rename release.config to web.config, after backing up the old web.config if you're upgrading.  Also, if you're upgrading, make sure you retain the MachineKey values in AppSettings. Let's get started...1. Register at, and download zip2. Unzip contents into c:\inetpub\dnn3 3. Create SQL database “dnn3“, add user: dnnuser as dbowner 4. Update .sln file's 2nd line, the web project web path from the default of “http://localhost/dotnetnuke/etc“ to “http://localhost/dnn3“ 5. Update sql connectionstring in web.config 6. Make sure your IIS user acct has privs to create files & folders in c:\inetpub\dnn3 (read instructions for detailed priv requirements to lock it down!) 7. Browse to the site http://localhost/dnn3, installation will commence Note, if the install fails at step 7, you're best-off removing the db, and the folder completely, and restarting the process.  If the install processes fall out of sync, it's a pain to recover from.  The step 7 problems I had were due to messing up step 6.  I went to the instructions to get detailed priv info for my iis acct. Next - I have some observations to make... Telligent's Community Server takes a few less steps, and is much easier on the non-geek trying to grow a social-network:1. download the install.exe2. double-click the install.exe3. Do what the wizard says.Us geeks on the other hand get a thrill  figuring out how to iron out the wrinkles of an open-source deployment... Also, on, there's news of “dotnetnuke sub-projects”, which strangely incorporate only Weblogs, Forums, and a Gallery at this moment.  For those of you following Telligent's Community Server, you will notice an obvious parallel.  I have been with DNN for a long time, and I'm also a big fan of Telligent's work.  I have to wonder why these two didn't pull their acts together and share the skill they both obviously have.  It may have something to do differences between licensing agreements & commercialization. Anyway... the install is complete, and I'm staring at a beautiful, rich DNN interface that blows the socks off DNN2.  Multiple super-user accountsDrag & drop modulesModules decoupled from the coreModule content XML Import/Export That's in the 1st 2 minutes of looking around.  Time to recompile all my custom modules to version 3 now![...]

DNN2: Adding Actions to an existing DotNetNuke module's Options Menu in 12 steps

Thu, 14 Oct 2004 20:52:00 GMT

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 Adding options to your module's flyout can be a little tricky. The following list uses code in C#, and applies to any existing module projects in VS 2003. If you have yet to create your module, you may want to read DNN: Create a custom DotNetNuke Module in a dozen steps! first. 1. Add new User Control to existing module project2. Update control to inherit from DotNetNuke.PortalModuleControl3. Update Namespace to [company].DNN.Modules.[modulename]4. Add using statement for DotNetNuke 5. Save and compile new empty control6. Manually add Module definition for each new control to the Module Definitions for the module   Type is used for security, Key is used to programatically reference a control7. Add Menu option(s) by adding Action(s) at end of initial ("View") page's Page_Init   base.Actions.Add(base.GetNextActionID(), "My Module Options", "", "", "", base.get_EditURL("","","Options") , "",false, SecurityAccessLevel.Edit, true, false);8. Update .dnn file to include control section, and add file element(s)   Options      MyOptionsPage.ascx   Edit9. Design Additional pages   Set CSS for text controls to DNN styles:   Linkbuttons: CommandButton   Validators: NormalRed   Form Prompts: SubHead   Text: Normal10. Include a cancel linkbutton to return back to :    try{Response.Redirect(get_NavigateURL(""),true);}   catch(Exception ex){DotNetNuke.Exceptions.ProcessModuleLoadException(this, ex));}11. Test through DNN until you're ready to package.12. Create module package   Identify all items needed in module, make sure they're included in .dnn file under    Zip up all items and upload package in File Manager Next I'll cover a much easier topic: Storing and Retrieving data for Module Settings. !!!NOTE REGARDING DNN 3 BREAKING EditURL():"Change Name: EditUrl Logged by: smcculloch (Scott McCulloch) Area of Impact: Custom Modules Impacted DNN Versions: All currently released versions Who is Impacted: Third Party Module Developers Short Description: Added function overloads to EditUrl (formerly a property) Full Description: Most custom modules use the EditUrl property of the PortalModuleControl for linking off to other controls in the module. Properties with optional arguments are not very well supported by C#. So the property has now moved to a function with a number of overloads. Workaround or Recommended Course of Action: There should be no code changes required, just a recompile for binary compatibility (change from a property to a method). " !!!NOTE REGARDING DNN 3 BREAKING NavigateURL() Name: NavigateUrl Logged by: smcculloch (Scott McCulloch) Area of Impact: Custom Modules Impacted DNN Versions: All currently released versions Who is Impacted: Third Party Module Developers Short Description: Full Description: Most custom modules use the NavigateUrl property of the PortalModuleControl for linking off to other controls in the module. Properties with optional arguments are not very well supported by C#. So the property has now moved to a function with a number of overloads. There should be no code changes required, just a recompile for binary compatibility (change from a property to a method). The method has also been moved to the Globals class, so other items such as Skin Objects, and other sections of code in DotNetNuke have access to this functionality. Workaround or Recommended Course of Action: No workaround. It will be[...]

DNN2: Create a custom DotNetNuke Module in 12 steps

Tue, 12 Oct 2004 21:49:00 GMT

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!


DNN: Understanding the DotNetNuke .dnn File

Tue, 12 Oct 2004 15:07:00 GMT

The .dnn file defines the framework of a DotNetNuke module's Private Assembly.  I have yet to find a good source of concise documentation, so I wrote my own.  Here's a simple file layout (with comments).  I will discuss the various parts afterwards:

       [controlname for controls hash]
       [title of view control]
       [view control's ascx filename]



     [all files for module, including graphics, ascx file, assembly(s), etc



The fields are straightforward until you get to the Control elements.  Add a element for each control in your module.
   Uniquely identifies the control in the module.  You may refer to the control programatically by this key.
          Actions are added to the module's flyout menu in the page_init section of the view page, and must refer to a control's key.
   The title of the action on the flyout is the same as the Title of the control. <BR>   <src> name of .ascx file<BR>   <type> Item from the DotNetNuke.SecurityAccessLevel enum: {Admin, Anonymous, Edit, Host, SkinObject, View}<BR>          Type is what allows DNN to handle security for your controls.</P> <P>All files that are part of the final module need to be included in the <file> elements.<BR>   Images & Resources<BR>   .ascx file(s)<BR>   Assembly file(s) (don't forget to compile in release mode)<BR>   .sql Scripts<BR>   Stylesheets</P>(image) <div class='clearbothFix'></div> </div><br /> <hr /><br /><div class="item"> <a href="" rel="nofollow">DNN2: Set up a new DotNetNuke test environment in 12 steps</a><br /> <p>Mon, 11 Oct 2004 16:07:00 GMT</p> <P><EM><STRONG>Looking for DNN4 stuff??? Check my more recent posts:<BR>   * </STRONG></EM><A href=""><EM><STRONG>DNN4.02: Create Your DotNetNuke Development Environment</STRONG></EM></A><BR><EM><STRONG>   * </STRONG></EM><A href="dnn4.02:%20Quick%20&%20Dirty%20C# and VB Custom Modules"><EM><STRONG>DNN4.02: Quick & Dirty C# and VB Custom Modules</STRONG></EM></A><BR><EM><STRONG>   * </STRONG></EM><A href=""><EM><STRONG>DNN4.02: Starting New DotNetNuke Modules in C# or VB.Net</STRONG></EM></A></P> <P> <HR id=null> <P>With a lot of experimentation, and a lot of help from DNN sites like <A href=""></A>, I've finally got the DNN install down to a science... I wrote the following steps for DNN 2.12 in an environment with a SQL Backend, IIS with full privileges, and Visual Studio.</P> <P>The following method of installing DNN enables local debugging for both DNN, and any DNN Projects (custom modules).  </P> <P class=sidenote>1. Create the dotnetnuke database<BR>2. Create and unzip dotnetnuke (download from <A href=""></A>)<BR>3. In dotnetnuke folder create 2 folders: dnnbin and dnnframework<BR>4. Create dnn virtual directory in iis, point to dotnetnuke folder with all access rights<BR>5. Update web.config to reflect database connection info<BR>    Update web.config's compilation debug attribute from false to true<BR>6. Go to new dotnetnuke install via browser, database update will begin, portal should open<BR>7. Open dotnetnuke solution, set dotnetnuke project as default project, and it's default.aspx page as start page<BR>    In DotNetNuke Properties, under Configuration Properties-Debugging, enable ASP.NET debugging (f5 to build & test)<BR>8. In dotnetnuke project properties, change to all configurations, update build folder to dnnbin (instead of just bin)<BR>9. Repeat for all projects but have them build to their own bin folder (instead of ..\..\bin)<BR>10. Add new class library project to the solution, called dnnframework, located in dotnetnuke folder<BR>11. Set dnnframework build location for all configurations to ..\bin (so it goes into dotnetnuke\bin)<BR>12. New modules should be added as a new project, and exist inside the DotNetNuke\DesktopModules\ModuleName folder. Add references to all other projects in dnnframework (rebuild and see that everything works fine)  </P>Tomorrow, I'll cover creating a simple, single-page DNN Module (in C#)(image) <div class='clearbothFix'></div> </div><br /> <div class="item"> <center> <h3><a href=''>Comments (0) - Read and Add your own Comments</a></h3> </center> </div> </div> <!-- google_ad_section_end --> </div> <div class="col-md-3 hidden-sm hidden-xs"> <script type="text/javascript"> ( function() { if (window.CHITIKA === undefined) { window.CHITIKA = { 'units' : [] }; }; var unit = {"calltype":"async[2]","publisher":"marksavoca","width":120,"height":600,"sid":"Feed_preview_right"}; var placement_id = window.CHITIKA.units.length; window.CHITIKA.units.push(unit); document.write('<div id="chitikaAdBlock-' + placement_id + '"></div>'); }()); </script> <script type="text/javascript" src="//" async></script> </div> </div> <div class="row"> <!-- FOOTER --> <div id="footer" class="col-md-12"> <script type="text/javascript"><!-- post_view(11205850); //--></script> <!-- google_ad_section_start(weight=ignore) --> <div> Copyright 2006-2015 <a href=""> LLC</a><br /><br /> <a href="">Privacy policy</a> - <a href="">Sitemap</a> - <a href="">Press</a> - <a href="">Terms of Service</a> - <a href="">Copyright information</a><br /> <a href="">Contact Us</a> - <a href="">About Us</a> - <a href="">Feedage</a> - <a href="" target="_blank">Search Engine Consulting</a><br /><br /> <small>Language Detection Powered by</small><a href=""><img src="" width="51" height="15" title="دعم فني" alt="دعم فني"/></a><br /><br /> </div> <!-- google_ad_section_end --> </div> <!-- END FOOTER --> </div> </div> </body> </html>