使用c#在asp.net中排序列表和下拉列表

我有一个方法,它返回一个sortedList,我想将它数据源到Dropdownlist。

我在用

DropDownList1.DataSource=stList; DropDownList1.DataValueField=stList.ContainsValue(); DropDownList1.DataTextField=stList.ContainsKey(); DropDownList1.DataBind(); 

但它给出了一个错误:containsKey和containsValue没有重载方法。 如何在下拉列表中填充此已排序的表?

 DropDownList1.DataSource = stList; DropDownList1.DataValueField = "Key"; DropDownList1.DataTextField = "Value"; DropDownList1.DataBind(); 

[编辑]

添加测试的工作代码:

 SortedList list = new SortedList(); list.Add(1, "Test1"); list.Add(2, "Test2"); dropDownList.DataTextField = "Value"; dropDownList.DataValueField = "Key"; dropDownList.DataSource = list; dropDownList.DataBind(); 
  Dim SL As New SortedList(Of String, String) SL.Add("A", "1") SL.Add("B", "2") DD1.DataSource = SL DD1.DataTextField = "key" DD1.DataValueField = "value" DD1.DataBind()