Пример #1
0
        public JsonResult GetCountry(string Country)
        {
            //clsSubmitModel oSubmit = new clsSubmitModel();
            DataTable dt;

            dt = oSubmit.GetCountry(Country);
            var result = new List <KeyValuePair <string, string> >();

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new KeyValuePair <string, string>(dr["citycode"].ToString(), dr["cityname"].ToString()));
            }
            var result3 = result.Where(s => s.Value.ToLower().Contains(Country.ToLower())).Select(w => w).ToList();

            return(Json(result3, JsonRequestBehavior.AllowGet));
        }