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.

Comments

Popular posts from this blog

Breaking down document locking in SharePoint

Working around X-Frame-Options for iframes

Document ID not being generated