public ActionResult Create() { if (Session["LogedUserID"] != null) { try { var doc = db.SP_SelectDoctor(); return(View(doc)); } catch (Exception ex) { ViewBag.errorMessage = "Error occurred while loading data."; return(View()); } } else { return(RedirectToAction("AdminLogin", "Account")); } }