public ActionResult Index(string Username, string Password) { AdminTable user = af.Login(Username, Password); if (user.Username != null) { Session["id"] = user.ID; Session["role"] = user.Role; return(Redirect("/CMS/")); } else { ViewBag.Msg = "<b>Forkert login</b>"; return(View()); } }