Common function to dynamically fill dropdownlists and get selected text – better approach

Now this is useful only if you don’t want to use Database for storing dropdownlist’s values, otherwise i would prefer using it DB or XML.

I’ll jump directly to the code, I hope you are not a newbie 🙂

Enum for the type of dropdownlist to be filled:

public enum DDLType
{
Education = 1,
Experience,
Salary,
}

Filling dropdownlist based on enum value

public class UtilityManager
{

//place for utility functions and inner classes…

//Inner class for all the functions related to server side controls..
public class ControlsManager
{
public static DropDownList FillDropDownList(DropDownList ddl, DDLType type)
{
switch ((int)type)
{ Read the rest of this entry »