/// <summary> /// to get the District Name from the database and bind it to the DropDownDistrict /// </summary> private void BindDropDownDistrict() { MasterBLL objMasterBLL = new MasterBLL(); ddlDistrict.DataTextField = "DistrictName"; ddlDistrict.DataValueField = "DistrictID"; ddlDistrict.DataSource = objMasterBLL.LoadDistrictData(); ddlDistrict.DataBind(); // for contact person ddlCPDistrict.DataTextField = "DistrictName"; ddlCPDistrict.DataValueField = "DistrictID"; ddlCPDistrict.DataSource = objMasterBLL.LoadDistrictData(); ddlCPDistrict.DataBind(); }
/// <summary> /// To bind details to dropdownlist /// </summary> private void FillDistricts() { MasterBLL objMasterBLL = new MasterBLL(); ddlDistrict.DataTextField = "DistrictName"; ddlDistrict.DataValueField = "DistrictID"; ddlDistrict.DataSource = objMasterBLL.LoadDistrictData(); ddlDistrict.DataBind(); }
/// <summary> /// Bind Data to Drop Downs /// </summary> private void BindDropDownDistrict() { MasterBLL objMasterBLL = new MasterBLL(); ddlDistrict.DataTextField = "DistrictName"; ddlDistrict.DataValueField = "DistrictID"; ddlDistrict.DataSource = objMasterBLL.LoadDistrictData(); ddlDistrict.DataBind(); ddlDistrict.Items.Insert(0, (new ListItem("--Select--", "0"))); ddlDistrict.SelectedIndex = 0; }