/ Published in: VB.NET
Add Item to DropDownList After DataBind
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
ddlAuthor.DataTextField = "FullName" ddlAuthor.DataValueField = "AuthorID" ddlAuthor.DataSource = authorDB.GetAuthors() ddlAuthor.DataBind() 'ERROR ---> ddlAuthor.Items.Insert(0, "-- Select Author --") ddlAuthor.Items.Insert(0, New ListItem("-- Select Author --", "0"))
URL: http://digitalcolony.com/2007/03/add-item-to-dropdownlist-after-databind.aspx