Nearly half of your module development can be spent creating database objects (tables and stored procedures) and data access methods. You can leverage the DotNetNuke framework and reduce or eliminate this task.
Module Settings will allow you to easily store data that is specific to an instance of a module. A DotNetNuke module can be placed on multiple pages in a portal (even on the same page). Each time is a separate instance.
Module Settings is usually used to store the data for the Settings user control of a module, but it can be used on any of the module's user controls.
Personalization will store data that is specific to a single user. With the DotNetNuke Survey module, personalization is used to determine if an authenticated user has voted before. If they have they are only showed the results and not allowed to vote again.
We used this code to save data to the Module Settings:
DimobjModules As New DotNetNuke.Entities.Modules.ModuleController
DotNetNuke.Entities.Modules.ModuleControllerobjModules = new DotNetNuke.Entities.Modules.ModuleController();
We retrieve the data using this code:
txtClosingDate.Text = CType(Settings("surveyclosingdate"), Date).ToShortDateString
txtClosingDate.Text = Convert.ToDateTime(Settings["surveyclosingdate"]).ToShortDateString();
To implement Personalization this code is used:
DotNetNuke.Services.Personalization.Personalization.SetProfile(ModuleId.ToString, "Voted", True)
DotNetNuke.Services.Personalization.Personalization.SetProfile(ModuleId.ToString(), "Voted", true);
We retrieve the Personalization setting using this code:
' Check if the user has voted
If Not DotNetNuke.Services.Personalization.Personalization.GetProfile(ModuleId.ToString, "Voted") Is Nothing Then
Return CType(DotNetNuke.Services.Personalization.Personalization.GetProfile(ModuleId.ToString, "Voted"), Boolean)
// Check if the user has voted
if (!(DotNetNuke.Services.Personalization.Personalization.GetProfile(ModuleId.ToString(), "Voted") == null))
return ((bool)(DotNetNuke.Services.Personalization.Personalization.GetProfile(ModuleId.ToString(), "Voted")));
Generally you will want to create tables and stored procedures and data access methods so that you can optimize performance. However, many situations may exist where minimal amounts of data are needed and development time can be reduced by leveraging the DotNetNuke framework.
DotNetNukeŽ is a registered trademark of Perpetual Motion Interactive Systems Inc.