Hi,
Try below solution:
ASPX HTML:
<asp:DropDownList runat="server" ID="ddlList" CssClass="form-control"> </asp:DropDownList>
<asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidator3" ErrorMessage="Please select from the list." InitialValue="" ControlToValidate="ddlList" runat="server" />
Code
ddlList.DataSource = objSource;
ddlList.DataTextField = "Description";
ddlList.DataValueField = "Code";
ddlList.DataBind();
ListItem liSelect = new ListItem();
liSelect.Text = "--- Please Select ---";
liSelect.Value = "";
ddlList.Items.Insert(0, liSelect);
This is fully working code.