public ActionResult GetAuctionFrontEndID() { dynamic AuctionID = 0; try { if (ModelState.IsValid) { AuctionServiceClient service = new AuctionServiceClient(); AuctionID = service.AuctionFrontEndID(); //return Json(AuctionID, JsonRequestBehavior.AllowGet); } } // Please through Exeption Everywhere catch (Exception e) { ModelState.AddModelError("error", "Something Wrong"); AuctionID = null; throw e; } return(Json(AuctionID, JsonRequestBehavior.AllowGet)); }