Esempio n. 1
0
 protected void DropDownpermanentState_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (DropDownpermanentState.SelectedIndex != 0)
     {
         byte stateId = byte.Parse(DropDownpermanentState.SelectedValue);
         DropDownpermanentDistrict.DataSource     = mpDetailsBAL.loadDistrict(stateId);
         DropDownpermanentDistrict.DataTextField  = "districtName";
         DropDownpermanentDistrict.DataValueField = "districtId";
         DropDownpermanentDistrict.DataBind();
         DropDownpermanentDistrict.Items.Insert(0, new ListItem("Select District", "0"));
     }
     else
     {
         DropDownpermanentDistrict.Items.Clear();
         DropDownpermanentDistrict.Items.Insert(0, new ListItem("Select Distirict", "0"));
     }
 }
Esempio n. 2
0
 protected void loadpermanentDistrict()
 {
     if (DropDownpermanentState.SelectedIndex != 0)
     {
         byte stateId = byte.Parse(DropDownpermanentState.SelectedValue);
         DropDownpermanentDistrict.DataSource     = mpDetailsBAL.loadDistrict(stateId);
         DropDownpermanentDistrict.DataTextField  = "districtName";
         DropDownpermanentDistrict.DataValueField = "districtId";
         DropDownpermanentDistrict.DataBind();
         DropDownpermanentDistrict.Items.Insert(0, new ListItem("Select District", "0"));
         string pDistrict = dt1.Rows[0]["permanentDistrict"].ToString();
         //  DropDownpermanentDistrict.Items.FindByText(pDistrict).Selected = true;
     }
     else
     {
         DropDownpermanentDistrict.Items.Clear();
         DropDownpermanentDistrict.Items.Insert(0, new ListItem("Select Distirict", "0"));
     }
 }