protected void GetState(int CountryID) { ddlState.Items.Clear(); List <Statetbl> lststate = new List <Statetbl>(); Statetbl ste = new Statetbl(); ste.CountryID = CountryID; StateBL objstatebl = new StateBL(); ste.IsActive = 1; lstState = objStateBL.GetStateByCountryIdIsActive(ste).ToList(); ListItem l = new ListItem(); l.Text = "--Select--"; l.Value = 0.ToString(); ddlState.Items.Add(l); foreach (var st in lstState) { ListItem li = new ListItem(); li.Text = st.StateName; li.Value = st.StateID.ToString(); ddlState.Items.Add(li); } }