public static void DDLState(Controller _controller, string key = "Title", string value = "Title", object selected = null, string countryName = null) { using (var objBLL = new MasterBLL()) { _controller.ViewBag.States = new SelectList(objBLL.GetStates(countryName), key, value, selected); } }
public JsonResult GetState(string countryname) { ResultVM result = new ResultVM(); try { using (MasterBLL oMasterBLL = new MasterBLL()) { result.Data = oMasterBLL.GetStates(countryname); result.IsSuccess = true; } } catch (Exception ex) { result.Errors = ex; result.Message = ex.Message; result.IsSuccess = false; Helper.LogException(ex, "MasterController_GetState"); } return(Json(result, JsonRequestBehavior.AllowGet)); }