We can also add items in DropDownList/ListBox from server side.
There is one method Items.Add of DropDownList/ListBox to add items.
Example :
In this exaple we are adding to Items in List box from server.
There is one method Items.Add of DropDownList/ListBox to add items.
Example :
Dim objListItem As ListItem
objListItem = New ListItem("Software", 1)
ddlProduct.Items.Add(objListItem)
objListItem = New ListItem("Hardware", 2)
ddlProduct.Items.Add(objListItem)
objListItem = New ListItem("Software", 1)
ddlProduct.Items.Add(objListItem)
objListItem = New ListItem("Hardware", 2)
ddlProduct.Items.Add(objListItem)
In this exaple we are adding to Items in List box from server.