Instead of using AppendDataboundItems='true'
(which will cause the problem you are talking about), respond to the DataBound
event for the DropDownList
and then add your "blank" item to the top of the list.
<asp:DropDownList runat="server" ID="MyList"
ondatabound="MyListDataBound"></asp:DropDownList>
Then in your code behind:
protected void MyListDataBound(object sender, EventArgs e)
{
MyList.Items.Insert(0, new ListItem("- Select -", ""));
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…