public ActionResult Detail(string pid) { if (string.IsNullOrEmpty(pid)) { return(RedirectPermanent(Url.Content("~/People/Person"))); } else { var data = _PersonBAL.Person_GetAllByIdBAL(pid); if (data == null) { ViewData["model"] = Url.Content("~/People/Person"); return(View("Static/NotFound")); } else { ViewData["model"] = data; return(View()); } } }