[AcceptVerbs(HttpVerbs.Post)]

搞了那么久用浏览器居然访问不了Login页面,偶要晕咯,原来加了[AcceptVerbs(HttpVerbs.Post)]东东,居然是button才能访问的

[AcceptVerbs(HttpVerbs.Post), Authorize]
        public ActionResult Login(string gg, string psword)
        {
            // string rr = Request.QueryString(id);
            if (gg == "admin" && psword == "123")
            {
                return View();
            }
            else
            {
                this.ModelState.AddModelError("msg", "你妹");
                return View("Yu");
            }


        }

你可能感兴趣的:(java,浏览器)