R
Randall Parker
Using DropDownList to create select/option tags in HTML how to make the first option
be a blank string?
I have fields with optional values. Currently I'm populating the DropDownList by
querying out a list of choices from a table. But the table shouldn't have a blank row.
A couple of possibilities:
1) Use a UNION query. I've done this in MS Access with combo boxes and the first
member of the union returns a single row. I can't remember the SQL syntax for
returning a single row that is not from a table though. Anyone know how?
2) Populate the DropDownList in CodeBehind without a bind of a result set. Just add a
blank row and then do a foreach on the dataset that has the real rows and add all them.
3) Some other approach?
be a blank string?
I have fields with optional values. Currently I'm populating the DropDownList by
querying out a list of choices from a table. But the table shouldn't have a blank row.
A couple of possibilities:
1) Use a UNION query. I've done this in MS Access with combo boxes and the first
member of the union returns a single row. I can't remember the SQL syntax for
returning a single row that is not from a table though. Anyone know how?
2) Populate the DropDownList in CodeBehind without a bind of a result set. Just add a
blank row and then do a foreach on the dataset that has the real rows and add all them.
3) Some other approach?