日期:2014-05-17 浏览次数:20537 次
private ListItem[] sourceGet()
{
string[,] books = {
{"aaa","111"},
{"bbb","222"},
{"ccc","333"},
{"ddd","444"},
{"eee","555"},
{"fff","666"},
{"ggg","777"},
{"hhh","888"}
};
ListItem[] items = new ListItem[8];
for (int i = 0; i < books.GetLength(0); i++)
{
items[i] = new ListItem(books[i, 0], books[i, 1]);
}
return items;
}
if (!IsPostBack)
{
DropDownList1.DataSource = sourceGet();
DropDownList1.DataBind();
}