public ActionResult ActiveUser(string ActiveCode) { string status = string.Empty; var user = db.GetUser(ActiveCode); if (user != null) { status = db.ActiveUser(user); } else { status = "Error"; } ViewBag.Status = status; if (status == "Success") { ViewBag.User = user; } else { ViewBag.User = null; } return(View()); }