Link to home
Start Free TrialLog in
Avatar of frosty1
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
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();

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of masterpass
masterpass
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of frosty1
frosty1

ASKER

great, thanks :)