关键代码:
1
DropDownList1.DataTextField = "value";
2
DropDownList1.DataValueField = "key";
3
DropDownList1.DataSource = getTypeList();
4
DropDownList1.DataBind();

2

3

4

实例代码:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20
