Example #1
0
 public JsonResult GetCountries(string term)
 {
     try
     {
         CommonModel model = new CommonModel();
         model.SearchString = term;
         List <CommonModel> countryList = model.GetCountries();
         var jsonData = new
         {
             rows = (from data in countryList
                     select new
             {
                 i = data.CountryID,
                 cell = new string[] {
                     data.CountryName.ToString(),
                 }
             }).ToList()
         };
         return(Json(jsonData, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         UtilityController.LogException(ex, MethodBase.GetCurrentMethod().ReflectedType.Name, MethodBase.GetCurrentMethod().Name);
         return(null);
     }
 }