boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

Add “Please select …” as first item in the DropDownList from the server side in ASP.NET

Updated on     Kisan Patel

This post will show you how to write “Please select …” as the first item in the DropDownList control while populating them from the server side in ASP.NET.

Default.aspx

<asp:DropDownList ID="dropDownList1" runat="server">
</asp:DropDownList>

Default.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
     if (!IsPostBack)
     {
         PopulateDataNow();
     }
}
private void PopulateDataNow()
{
     // populate the data into the DropDownList
     dropDownList1.DataSource = GetData(); //Your Data Source
     dropDownList1.DataBind();
     dropDownList1.Items.Insert(0, new ListItem("Please Select ...", "0"));
}

In above code, the DropDownList is populated from the code behind needs to write “Please select …” using the dropDownList1.Items.Insert(0, new ListItem("Please Select ...", "0")); method by specifying the index as 0 so that it appears as the first item.


ASP.NET

Leave a Reply