I want to bind the value and the name of the enum to the dropdownlist. I've been looking around about how to do this, and found some examples, but it's not working for me for some reason:
public enum Salutations
{
Mr = 1,
Ms = 2,
Mrs = 3
}
string[] names = Enum.GetNames(typeof(Salutations));
Array values = Enum.GetValues(typeof(Salutations));
for(int i=0; inew ListItem(names[i], values[i].ToString());
ddlSalutations1.Items.Add(item);
} The problem is trying to access the value in values. I can't do it for an Array. How can I modify this?