public ActionResult jobType(int?id) { tbljobType _model = new tbljobType(); jobServices _services = new jobServices(); if (id.HasValue) { _model = _services.GetjobtypebyId(id.Value); return(View("edittype", _model)); } if (TempData["error"] != null) { ViewData["error"] = TempData["error"].ToString(); } return(View(_model)); }