DotNetNuke Modules – Retrieving Settings
On Monday we discussed how to save setting information for our modules. Today we want to pick back up where we left off and deal with retrieving that information, both in the LoadSettings() method and in the view module.
The Primary Method of Retrieval
The main retrieval method is the Settings property that is available in both the view and the settings module. This is an indexed property that takes the key we specified in the Update methods as the indexer and returns the string that we saved as the value.
Behind the scenes, this property looks in the instance-specific settings and then in the global settings for the module and retrieves the data for us. Since the property is set up as a hash table, all return values are typed as objects. You’ll need to cast them to strings before you actually do anything with them.
Alternate Properties
You can also use the TabModuleSettings[] property and the ModuleSettings[] property to get the specific information. The only reason I can think that you might want to do this is if you managed to make the key the same for a global setting and a module instance setting. But that wouldn’t be very smart, and my naming convention for the keys makes that practically impossible.
Limitations …
The last bit of information you need to know about module settings is that the value can only be up to 2000 characters long. At the risk of sounding like Bill Gates, 2000 characters ought to be enough for anyone.
But of course it isn’t always.
… and Solutions
I’ve only had one instance where I needed to store more than 2000 characters and fortunately I was reasonably sure that 4000 characters would do the trick. So, I just split the data between two keys and stored half in one and half in the other.
The other solution, of course, is to store this information in your own table where you have control over the size and/or can delete rows as the data shrinks.
Other post in DotNetNuke - Module Development
- Creating DotNetNuke Modules - May 20th, 2008
- Creating DNN Modules - The Tools - May 22nd, 2008
- DotNetNuke Modules - Foundational Concepts - May 26th, 2008
- DotNetNuke Modules - Install DNN into VS 2008 - May 27th, 2008
- DotNetNuke Modules - Creating Base Modules - May 28th, 2008
- DotNetNuke Modules - Registering Your Module - May 29th, 2008
- DotNetNuke Modules - Where Stuff Shows Up - June 3rd, 2008
- DotNetNuke Modules - Benefits of Architecture - June 4th, 2008
- DotNetNuke Modules - Anatomy of the View - June 9th, 2008
- DotNetNuke Modules - Adding Actions - June 11th, 2008
- DotNetNuke Modules - DNN Controls - Label - June 18th, 2008
- DotNetNuke - Internationalization - June 25th, 2008
- DotNetNuke Modules - Internationalization (part 2) - June 30th, 2008
- DotNetNuke Modules - Labels w/ no Help - July 9th, 2008
- DotNetNuke Modules - LinkButtons - July 14th, 2008
- DotNetNuke Modules - Collapsible Panels - July 16th, 2008
- DotNetNuke - The Data Layer - Installing CodeSmith - July 22nd, 2008
- DotNetNuke - Modules - Creating The Tables - July 24th, 2008
- DotNetNuke - Modules - Creating Stored Procs - July 29th, 2008
- DotNetNuke - Modules - Portal Specific Modules - July 31st, 2008
- DotNetNuke Modules - Data Access Layer - August 5th, 2008
- DotNetNuke Modules - Data Access Layer - August 7th, 2008
- DotNetNuke - Data Access Layer Alternative - August 12th, 2008
- DotNetNuke - Modules - Linking within the module - August 14th, 2008
- DotNetNuke - Make Your Module Searchable - August 19th, 2008
- DotNetNuke Modules - Making Content Portable - August 25th, 2008
- DotNetNuke Modules - Exceptions the DNN Way - September 2nd, 2008
- DotNetNuke Modules - PortalModuleBase - September 4th, 2008
- DotNetNuke Modules - Inter Module Communication - September 9th, 2008
- DotNetNuke Modules - Finding The Page a Module is On - September 15th, 2008
- DotNetNuke Modules - Caching - September 17th, 2008
- DotNetNuke Modules - Module Settings - September 22nd, 2008
- DotNetNuke Modules - Retrieving Settings - September 24th, 2008
- DotNetNuke Modules - Advanced Architecture - October 20th, 2008
- DotNetNuke Modules - Creating the PA - October 30th, 2008
- DotNetNuke Modules - Automating the PA - November 5th, 2008
- DotNetNuke - FileUploadControl Danger! - February 26th, 2009
- DotNetNuke SecurityException AspnetHostingPermission - October 14th, 2009
- Changing an Existing DNN Module - March 4th, 2010
Other Related Items:
Ladies Black Yoga Pants 26 Piece Stone Setting on Front WaistLadies Black Yoga Pants 26 Piece Stone Setting on Front Waist
Standard Deviants School NB Personal Finance Module 2: Saving StrateThe Standard Deviants will teach you how to manage your finances, starting with saving strategies that will help you hold on to your money once you've earned it. Then it's on to investing, including such exciting topics as risk tolerance and investment allocation strategies.
Princeton Tec Eos Rebel Bike Light (Black with Black Lens Ring)Princeton Tec Eos Bike Maxbright Rebel LED Headlight.
Eos Bike takes self-contained battery lighting to the next level. The combination of a Maxbrigh... Read More >









