Live Chat Icon For mobile
Live Chat Icon

How to add an extra item to the DropDownList filled with data from a database?

Platform: ASP.NET| Category: Dropdownlist

VB.NET


’DropDownList1.Items.Insert(0, 'Please Select')
DropDownList1.Items.Insert(0, new ListItem('<text>', '<value>'))

C#


//DropDownList1.Items.Insert(0, 'Please Select');
DropDownList1.Items.Insert(0, new ListItem('<text>', '<value>'));

This should be done after .DataBind of dropdownlist

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.