Adding Value to DropDownList

admin

Administrator
Staff member
I have a series of 3 dropdownlists that gets populated from a sql server table. I want to add a value to the dropdownlists, but I want it to always be the first value. When the user pulls up the page I want to add in the client dropdownlist "-- Select a Client --" instead of the first value in the sql table. Can this be done? The reason is that the second dropdownlist is being triggered by the indexchange event to build the values.

Thanks
ShannonYou have to have a 1-based table in the database to do it, but that's sort of a given. It can be done by doing this...


ddlName.Items.Insert(0, "-- Select a Client --")


You could also do it by creating a 0 record in the database and having it contain a "-- Select a Client --" record in whatever field gets displayed, but the first way is probably cleaner.Thanks. That did it.
 
Back
Top