List nameList = new List(); DropDownList ddl = new DropDownList();
List is populated here, then sorted:
Why not just bind the DDL directly to the List like
DropDownList ddl = new DropDownList(); ddl.DataSource = nameList; ddl.DataBind();