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.

  1. Jørgen’s avatar

    Thanks this saved me time!

  2. David Hunt’s avatar

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

  3. or’s avatar

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

  4. Weird CAPTCHA’s avatar

    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…

  5. MKSE.com CMS Nyheter’s avatar

    Heheh, is the last comment from a bot? Or what?

  6. Erik Nordin’s avatar

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

  7. Martin S.’s avatar

    Nice find! Thanks for sharing, man! :)

  8. SreeRaghavendra’s avatar

    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.

CAPTCHA image