public ActionResult TicketCreate() { string id = Convert.ToString(Session["LOGINID"]); List <SelectListItem> lstServiceTypes = new List <SelectListItem>(); DataSet ds = new DataSet(); try { ds = objgetTicket.getServiceTypes(); if (ds.Tables.Count > 0) { foreach (DataRow dR in ds.Tables[0].Rows) { lstServiceTypes.Add(new SelectListItem { Text = Convert.ToString(dR["ServiceType"]), Value = Convert.ToString(dR["Service_ID"]) }); } ViewBag.listServices = lstServiceTypes; } return(View()); } catch (Exception ex) { log.Error(ex); return(Json("Something went wrong..Try after some Time", JsonRequestBehavior.AllowGet)); } }