コード例 #1
0
        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);
        }
コード例 #2
0
 public ActionResult Index(UserModel um)
 {
     ViewBag.Title = "Home Page";
     this.ModelState.Clear();
     return View(um);
 }