frosty1
asked on
How do i set the default text for my asp.net dropdownlist
I wish to append the following to my dropdownlist
"--Please select one--"
As you see in the code below i am binding the dropdown with members. But this seems to override the new list item
"--Please select one--"
As you see in the code below i am binding the dropdown with members. But this seems to override the new list item
List<Member> members = MemberController.GetMembers();
DropDownListMembers.DataSource = members;
DropDownListMembers.DataTextField = "LoginName";
DropDownListMembers.DataValueField = "Id";
DropDownListMembers.Items.Insert(0, new ListItem("--Please select one--", ""));
DropDownListMembers.DataBind();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER