Monday, March 1, 2010

Retrieving appsettings keys & display in drop down list

//Retrieving appsettings keys & display in drop down list
        ArrayList entitylist=new ArrayList();
        Configuration config = WebConfigurationManager.OpenWebConfiguration("~");      


            // Get the appSettings.
            KeyValueConfigurationCollection appSettings =  config.AppSettings.Settings;


           foreach (string key in appSettings.AllKeys)
            {
                       entitylist.Add(appSettings[key].Value);
            }
           ddl_entitylist.DataSource = entitylist;
           ddl_entitylist.DataBind();

No comments:

Post a Comment