// [ValidateAntiForgeryToken] public ActionResult DoctorEntrance(FormCollection collection)//string Name, DateTime LicenseExpirationDate) { try { IBL bl = new BLImplement(); var d = bl.IsDoctor(collection["Name"], Convert.ToDateTime(collection["LicenseExpirationDate"])); if (d != null) { return(RedirectToAction("DoctorOptions", "Doctor", d)); } else { return(RedirectToAction("DoctorEntrance")); } } catch (Exception ex) { ViewBag.Message = String.Format(ex.Message); return(RedirectToAction("DoctorEntrance")); } }