Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 DotNetNuke Articles

One of the annoyances with ASP.NET and hence DotNetNuke is that to create your finished piece of coding there may well be a pieces of code in more than one file.  This becomes more annoying when trying to understand how DotNetNuke operates.  Hopefully by the time you have finished you first DotNetNuke module also you will fell that the layout makes sense.

I was putting together my first DotNetNuke module but was unable to find how you get those edit options when you place the mouse over the pencil icon for a module.  The aim was to produce something like the image below with extra edit options against the module for configuing items such as products and bookings.

Module Edit/configuratin options

My first point of investigation was the dnn configuration file associated with the module.  This file is used to define which files, .ascx, .ascx.vb and images are to be included in the module.  There is also a section which looks like it is associated with the edit options I was after.  I added the extra sections which I required, added this file, together with the various others into a zip file and uploaded them as a new module.  As you may have guessed, this is not the whole story.  Part of the dnn configuration file with the extra entries for Edit Booking, Edit Products, Edit Activities. is given below.  Note that all items to be used as we intend are given a type of Edit.

<FRIENDLYNAME>janet.Booking>/FRIENDLYNAME>
    <CONTROLS>
        <CONTROL>
            <SRC>Booking.ascx</SRC>
            <TYPE>View</TYPE>
        </CONTROL>
        <CONTROL>
            <KEY>Edit</KEY>
            
            <SRC>editBooking.ascx</SRC>
            <ICONFILE>taskedit.png</ICONFILE>
            <TYPE>Edit</TYPE>
        </CONTROL>
        <CONTROL>
            <KEY>Activities</KEY>
            
            <SRC>editActivities.ascx</SRC>
            <ICONFILE>taskedit.png</ICONFILE>
            <TYPE>Edit</TYPE>
        </CONTROL>
    <CONTROL>
            <KEY>Products</KEY>
            
            <SRC>editProducts.ascx</SRC>
            <ICONFILE>taskedit.png</ICONFILE>
            <TYPE>Edit</TYPE>
        </CONTROL>
        <CONTROL>
            <KEY>Groups</KEY>
            
            <SRC>editChargeTo.ascx</SRC>
            <ICONFILE>taskedit.png</ICONFILE>
            <TYPE>Edit</TYPE>
        </CONTROL>
    </CONTROLS>

The next step is to provide reference to these items in the code behind page associated with your module presentation code.  Expand the usually hidden Web Form Designer Generated Code region of the code behind file.  Here, in the page_init subroutine, you require some entries like

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
    ' PortalModuleControl base class settings for this module
    MyBase.HelpFile = "help.txt"
' a local document stored in the same folder as the user control
    MyBase.HelpURL = "http://www.dotnetnuke.com"
' a URL for support on the module
    ' action menu items
    MyBase.Actions.Add(GetNextActionID, "Edit Activities", "", URL:=EditURL(, , "Activities"), secure:=SecurityAccessLevel.Edit, Visible:=True
)
    MyBase.Actions.Add(GetNextActionID, "Edit Products", "", URL:=EditURL(, , "Products"), secure:=SecurityAccessLevel.Edit, Visible:=True
)
    MyBase.Actions.Add(GetNextActionID, "Edit Product Groups", "", URL:=EditURL(, , "Groups"), secure:=SecurityAccessLevel.Edit, Visible:=True
)
    MyBase.Actions.Add(GetNextActionID, "Edit Booking", "", URL:=EditURL(), secure:=SecurityAccessLevel.Edit, Visible:=True
)
End Sub

If you compare these entries with those from the dnn configuration file you will see that the EditURL option corresponds with the <KEY>option.  The </KEY>GetNextActionID parameter determines the phrase to be presented in the pop-up options menu


This article viewed: 3268 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

For DotNetNuke modules and skins take a look at:

Snowcovered

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Saturday, May 17, 2008