后台给DropDownList添加新选项。代码如下:

DropDownList1.Items.Add(new   ListItem("Text","value"));   //items.add是添加到最后
  DropDownList1.Items.Insert(Index,new   ListItem("Text","value"));  //items.insert添加到第index项中,index=0时添加到第一项

如果仍然无法显示添加内容请把AppendDataBoundItems设置为True

 

posted on 2009-09-04 16:22  superlee  阅读(259)  评论(0编辑  收藏  举报