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