public ActionResult Index(UserModel um, string dummy) { if (!this.ModelState.IsValid) return View(um); UserClass uc = BasicAuthentication.Authenticate(um.Username, um.Password); if (uc != null) { this.ViewBag.Message = string.Format("Hello {0}", uc.FullName); return this.RedirectToAction("ListMyItems", "Members"); } else { this.ModelState.AddModelError("1", "Invalid credentials. Please try again."); } return View(um); }
public ActionResult Index(UserModel um) { ViewBag.Title = "Home Page"; this.ModelState.Clear(); return View(um); }