public ActionResult Login(User objUser) { int id = iuser.userlogin(objUser); if (id > 0) { Session["UserID"] = id; Session["UserName"] = objUser.UserName; Session["Admin"] = iuser.GetUserByID(id).IsAdmin; return(RedirectToAction("Index")); } ViewBag.DuplicateMessage = "Invalid username or password"; return(View(objUser)); }