DotNetNuke Modules – Registering Your Module

Yesterday, we used the DotNetNuke template to create a skeleton module and it’s supporting files. Today, we want to get those modules registered into our Visual Studio copy of DotNetNuke so that as we develop the modules, we can see and test the changes we make.

To register the module, you will need to be logged into DotNetNuke as “host.” Login now and navigate to “Host” > “Portal Module Definitions.”

Once you are there, scroll to the bottom of that page and click the link, “Create Module Definition.” This will lead you to a screen with a lot of fields on it. The first time you come to this screen, you’ll probably wonder how you are suppose to know exactly what you should be doing here. Fortunately, you only HAVE to fill in a small subset.

  • Module Name: Give the module a name. In our case, we are calling it DMBSample
  • Module Directory: The directory your module is located in. Ours is DMBSample
  • Friendly Name: The text that you want to display in the dropdown list of available modules.
  • Descriptions: Describe what this module does.
  • Version: This is the first version, so leave the field with 01.00.00
  • Compatibility: This allows you to specify what version of DNN this module is compatible with. We can leave this blank.
  • Dependencies: List the typename dependencies. Again, you can leave this blank for now.
  • Permissions: Any special permissions this module requires. Leave it blank for this sample.
  • Controller Class: The class that implements ISearchable and IPortable. Don’t worry about this field for right now.
  • Premium: Since we are developing this module, we don’t want it to be limited. Leave this unchecked.

Once you’ve filled in those field, click the “Create” link.

But wait, there’s more…

Now that you’ve defined the main module, you need to tell it where the ASCX files are that make the module work. To start this, you’ll need to create a definition. Fill in the “New Definition” field with the name of the module–in our case, “DMBSample”–and click “Add Definition.”

Now we can add the various controls. Click the “Add Control” link that just displayed after the “Add Definition” completed. This will take you to another screen where you can define the control. The first control we will define is the main view, the presentation that the end user will ultimately see. For this, fill in Title with a title that represents the module, select the ViewDMBSample.ascx file from the “Source” dropdown, and leave the “Type” dropdown as “View”. If you plan to use AJAX with your module, select “Supports Partial Rendering”. That’s all you need to do for this control, so click “Update.”

The template created two other controls. One is the “Edit” control and the other is the “Settings” control. You’ll need to add these in a similar manner as the View. Click the “Add Control” link, and for the Edit control, put “edit” in the “Key” field. For the settings control, type “settings” into the “Key” field. Title can be something meaningful. Select the appropriate control from the dropdown. And for type, use “Edit” for the edit control and “Admin” for the setting control.

If you try to add this module to a page at this point, you’ll see an error message. Just hang on for the next lesson where we show you where the controls we just registered show up in the system and modify the code so that it doesn’t throw an exception.

 

Other post in DotNetNuke - Module Development

Like this Article? Subscribe to get every article sent to your email.

Related Post

  • DotNetNuke Modules – Creating Base ModulesDotNetNuke Modules – Creating Base Modules Now that we have DotNetNuke installed into Visual Studio we can go ahead and create our first modules. Actually, creating the modules is pretty simple. But it is even easier to do it […]
  • DotNetNuke Modules – Install DNN into VS 2008DotNetNuke Modules – Install DNN into VS 2008 Today, we will install DotNetNuke into Visual Studio so that we can create our first module. So fire up Visual Studio, and let's get going.I'll be using Visual Studio 2008 to walk […]
  • DotNetNuke – Modules – Linking within the moduleDotNetNuke – Modules – Linking within the module Now that we have the module skeleton up and running and we have a data access layer, the next thing we need to look at is specific functions you may need to use from within your code. One […]
  • DotNetNuke – InternationalizationDotNetNuke – Internationalization One of the core features of DotNetNuke is that all of the text that shows up on a page either comes out of the database or out of resource files.  Anything that comes out of the resource […]
  • DotNetNuke – Modules – Portal Specific ModulesDotNetNuke – Modules – Portal Specific Modules Many of you won't care too much about creating Portal Specific Modules because you'll be creating modules for an environment that only has one portal. However, if you are creating a […]

About Dave Bush

Dave Bush is a Full Stack ASP.NET developer. His commitment to quality through test driven development, vast knowledge of C#, HTML, CSS and JavaScript as well as his ability to mentor younger programmers and his passion for Agile/Scrum as defined by the Agile Manifesto and the Scrum Alliance will certainly be an asset to your organization.

  • http://aikon.com.ve Joaquin Windmüller

    I was able to complete all the steps of registering the module in my dnn site. And registered the three controls:

    Control Title Source
    Edit edit Edit? DesktopModules/LongText/EditLongText.ascx
    Edit settings Settings? DesktopModules/LongText/Settings.ascx
    Edit view Convert Long Text (MEMO) to 72 Character Lines DesktopModules/LongText/ViewLongText.ascx

    But when I try to add the module to a page no error appears. The module does not appear though.

    I’m using vb.net instead of c# (although I don’t think it makes any difference). Any ideas on what’s going on?

  • http://aikon.com.ve Joaquin Windmüller