The new properties AppSettings and AppSettingsMultiple in EPiServer CMS 5 is a pretty nice feature, but when yesterday when I tried to implement it, I had a hard time finding out how to do it. But finally I did.
First of all, in edit mode, AppSettings will create a DropDown and AppSettingsMultiple will create a CheckBoxList.
To create you AppSettings property you have to define some values in <appSettings> in your Web.Config, i did like this:
<add key="PropertyCountries" value="Czech republic;CR|Sweden;SV|United Kingdom;UK" />
Now you just have to add a Property to your pagetype with the name PropertyCountries and you are done.
When you use the AppSettingsMultiple the CurrentPage.Property["PropertyCountries"].Value will return a comma separated string with the selected values, like "SV,UK" and you just have to do a simple .Split(',') and you have a string array.
-
Thanks for that. Saved me from trying to find the documentation (if there is any).
-
The CAPCHA for the submission of this comment only required one character (in oppose to a word, or bunch of characters as is normal).
Strange. Anyone know if that really is bot-proof?
I’ve never seen it before… usually I make it at least 5 chars…
-
When the Dynamic List value is added through editor only the values are displayed as contents .How can I access Selected Text content?Is there any Property class’s function to access the selected Text instead of writing a logic by accessing it through web.config file.?
Thanks in advance.

8 comments
Comments feed for this article
Trackback link: http://antecknat.se/blog/2008/04/18/new-appsettings-and-appsettingsmultiple-in-episerver-cms-5/trackback/