dear sir
i have a dropdownlist i want to a default value and also other value in asp.net
thanks in advance
解决方案
Hi,
UploadSP spUpload = new UploadSP();
ddlStudent.DataSource = spUpload.StudenntNameViewForUploadingFile(Decimal.Parse(ddlClass.SelectedValue.ToString()),ddlDivision.Text);
ddlStudent.DataTextField = "studentName";
ddlStudent.DataValueField = "studentId";
ddlStudent.DataBind();
ddlStudent.Items.Insert(0, "--Select--");
Hi Dinesh
below Code will you to resolve your query
DataRow dr = ds.Tables[0].NewRow();
dr["CityName"] = "Select City";
dr["CityID"] = "0";
ds.Tables[0].Rows.InsertAt(dr, 0);
Dropdownlist.DataTextField = "CityName";
Dropdownlist.DataValueField = "CityID";
Dropdownlist.DataSource = ds;
Dropdownlist.DataBind();
What is your datatable Fields to Identify Default Columns