Learn More





DNN Community Blog

The Community Blog is a personal opinion of community members and by no means the official standpoint of DNN Corp or DNN Platform. This is a place to express personal thoughts about DNNPlatform, the community and its ecosystem. Do you have useful information that you would like to share with the DNN Community in a featured article or blog? If so, please contact .

The use of the Community Blog is covered by our Community Blog Guidelines - please read before commenting or posting.

DotNetNuke Module Development 101: 4 - Hello World 2 - Using WebMatrix to Create a Module

imageIn part 3 of this series on DotNetNuke Module Development we created our first module “Hello World”.  In this blog I will describe a second way that you can create modules.

The next method we will use is to create the same User Control (ascx file) in a simple IDE like WebMatrix.  WebMatrix is a free download from Microsoft, so is an excellent choice for novice or hobby developers who are just starting out on DotNetNuke development. 

When you launch WebMatrix you will be presented with a “QuickStart” dialog, if you Select “Open Site” and “Folder As Site” you can browse to your website and open it in WebMatrix.

Figure 1: Open an existing site in WebMatrix


Note that WebMatrix also allows you to open a remote site, so you can use WebMatrix to make minor changes to live Production sites.  In Figure 2 I show the “Files” view in WebMatrix with the HelloWorld.ascx file we created in the last post opened in the editor.

Figure 2: WebMatrix in File Mode



imageLets re-create the Hello World module using WebMatrix.

  1. We first right click on the My Modules folder - our Owner folder as described in the previous post
  2. Select the New Folder option to create a new Folder.
  3. Click on the new folder to rename it Hello World 2.
  4. Right-click on this new folder and select the New File option.
  5. Select the User Control option from the list of file types
  6. Give it the name HelloWorld2.ascx and select Ok (see Figure 3)


Figure 3: Create a new UserControl in WebMatrix


Just as in the previous post we need to edit the resulting HTML in order to render what we want.  In this case we will enter the text shown in Figure 4.  If you compare this with Figure 2 we have modified the code a little.  The class name has been changed to HelloWorld2 and the h1 tag text has been changed to “Hello World 2”

Figure 4: The Hello World 2 User Control


We have now created a “copy” of the previous module with slightly different text, using our external IDE - WebMatrix.  We could, of course have used a number of different IDE's to do this - some commercial, some free, or we could have used Notepad.  Now that we have created the User Control that implements IModuleControl, we need to add it to DotNetNuke, so that it is aware of its existence.

As in the previous post, to do this we need to be on the Host > Extensions page, and again we need to select the “Create New Module” option.  This time however, we select the “Control” option in the first dialog see Figure 5.

Figure 5: Creating the module from a Control



In this case rather than creating a new Control we are create a module from an existing Control. 

You will need to provide values for most of the fields as described below:

  1. Select “Control” to create a module from an existing Control.
  2. Select the “Owner” folder where the module is located in this case My Modules.
  3. Select the “Module” folder where the module is located - in this case Hello World 2.
  4. Select from the list of controls in this folder - in this case there is just one - HelloWorld2.ascx.
  5. Next you can provide a more friendly name for the module. This will be the name used to identify it in the application itself. You can also provide an optional description to describe what your module does.
  6. Finally you can check this box to automatically create a “Test Page” to host the module.
  7. When you are happy with the options you can click the Create Module button.

As before when we click the Create Module button we will be redirected to a new Test Page containing the module we just created.

Figure 6: The new Module deployed on a page


So now we have two ways to create simple modules that do not require a sophisticated IDE.  In the next post in this series I will show how we can do the same thing in Visual Studio and we will see how we can add “code” to the modules.

This post is cross-posted from my personal blog.


James Brown
How about putting links (at either the top or bottom of this article) to the other articles in the series. Probably should do this for all articles in the series - a link to each of the articles.
James Brown Sunday, April 19, 2015 12:00 PM (link)

Comment Form

Only registered users may post comments.


2sic Daniel Mettler (124)
Aderson Oliveira (15)
Alec Whittington (11)
Alex Shirley (10)
Andrew Nurse (30)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (21)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (203)
Chris Paterra (55)
Clinton Patterson (28)
Cuong Dang (21)
Daniel Bartholomew (2)
Dave Buckner (2)
David Poindexter (3)
David Rodriguez (2)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (74)
Geoff Barlow (6)
Gifford Watkins (3)
Gilles Le Pigocher (3)
Ian Robinson (7)
Israel Martinez (17)
Jan Blomquist (2)
Jan Jonas (3)
Jaspreet Bhatia (1)
Jenni Merrifield (6)
Joe Brinkman (269)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matthias Schlomann (15)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Mike Horton (19)
Mitchel Sellers (28)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Peter Donker (52)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott S (11)
Scott Wilkinson (3)
Scott Willhite (97)
Sebastian Leupold (80)
Shaun Walker (237)
Shawn Mehaffie (17)
Stefan Cullmann (12)
Stefan Kamphuis (12)
Steve Fabian (31)
Timo Breumelhof (24)
Tony Henrich (3)
Torsten Weggen (2)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (37)
Will Strohl (163)
William Severance (5)
Try Evoq
For Free
Start Free Trial
a Demo
See Evoq Live
Need More Information?