New AppSettings/Dynamic List (one option) and AppSettingsMultiple/Dynamic list (Multiple options) in EPiServer CMS 5

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.

16 thoughts on “New AppSettings/Dynamic List (one option) and AppSettingsMultiple/Dynamic list (Multiple options) in EPiServer CMS 5

  1. David Hunt

    Thanks for that. Saved me from trying to find the documentation (if there is any). 😉

  2. or

    why i get a “” for the first value and how i can change it to somthing else.
    10X a lot.

  3. Weird CAPTCHA

    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…

  4. Erik Nordin Post author

    That’s a good question, I’ve thought about it myself, but it was so entertaining that I kept it. 🙂

  5. SreeRaghavendra

    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.

Comments are closed.