public ActionResult Login(FormCollection post) { string account = post["account"]; string password = post["password"]; //驗證密碼 if (db.CheckUserData(account, password)) { Session["account"] = account; Response.Redirect("~/Home/Index"); return(new EmptyResult()); } else { ViewBag.Msg = "登入失敗..."; return(View()); } }