Beispiel #1
0
    public void BindCity()
    {
        DataSet dsCityMasterList = CCityMasterServices.CityMasterList();

        DropCity.DataSource     = dsCityMasterList;
        DropCity.DataTextField  = "Cityname";
        DropCity.DataValueField = "CityId";
        DropCity.DataBind();
    }
        public void fillcity()
        {
            List <CityMaster> _city = CityMasterCollection.GetAll().Where(x => x.STATE_ID == int.Parse(DropState.SelectedValue.ToString())).OrderBy(x => x.CITY_NAME).ToList();
            CityMaster        cm    = new CityMaster();

            cm.CITY_ID   = 0;
            cm.CITY_NAME = "-Select City-";
            _city.Insert(0, cm);
            DropCity.DataSource     = _city;
            DropCity.DataTextField  = "CITY_NAME";
            DropCity.DataValueField = ("CITY_ID");
            DropCity.DataBind();
        }