public ActionResult LoginRequest(LoginViewModel viewModel) { DataRepository helper = new DataRepository(); if (helper.UserCanLogIn(viewModel)) { viewModel.user = helper.GetUser(viewModel); Session["LoggedIn"] = "true"; Session["Username"] = viewModel.user.Username.ToString(); ViewData["ReloadPage"] = "true"; return PartialView(); } TempData["ErrorMessage"] = "Login Failed"; return PartialView(); }