Friday, August 9, 2013

#DotNetNuke | Using Module Settings


There are two types of module settings:

  • Module Settings
    •  Use if you want to share the settings with other instances of the Module
  • Tab Module Settings
    • Use if you want to save the settings for a specific Module instance, and re-declare them again on other instances.

Basic Operations

ModuleController objModules = new ModuleController();

Read Setting
(string)objModules.GetTabModuleSettings(TabModuleId)["mySetting"]

Write Setting
objModules.UpdateTabModuleSetting(TabModuleId, "mySetting", "my new value"));

Note: you can also access settings with (string)TabModuleSettings["BgImages"] but I wouldn't recommend it because it may send you cached versions with outdated information, specially if you use Ajax and Update Panels.

No comments:

Post a Comment