List nameList = new List(); DropDownList ddl = new DropDownList();
List is populated here, then sorted:
Replace this:
ddl.Items.Add(new ListItem(nameList[name].ToString()));
with this:
ddl.Items.Add(new ListItem(name));
Done like dinner.