Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: comma separated app config values for dropdown lists

  1. #1
    witchikikoy is offline Junior Member
    Join Date
    Oct 2009
    Posts
    14

    Default comma separated app config values for dropdown lists

    Hello everyone,

    I customized the createaccount.aspx page and added a dropdown list on it. What I want is that the values on the dropdown list will be coming from a comma-separated app config value.

    Can someone tell me how to do this?

    Thanks in advance for the help...

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    You can use something like this to get your AppConfig values into a string array:

    Code:
                string values = AppLogic.AppConfig("YourAppConfigName");
                values.Trim();
                string[] valuesArray = values.Split(',');
    Then just do a while loop on the array to add the values to your dropdown list.

  3. #3
    MarcJ is offline Senior Member
    Join Date
    Jan 2008
    Posts
    129

    Default

    Or something like this to keep from looping.

    Code:
        Dim valuesArray As New ArrayList
        valuesArray.AddRange(AppLogic.AppConfig("YourAppConfigName").Trim.Split(","))
        ddlDropList.DataSource = valuesArray
        ddlDropList.Databind