public ActionResult Index() { if (HttpContext.User.Identity.IsAuthenticated) { return View("Index"); } string user = HttpContext.Request["txtUser"]; if (user == null || user == "") return View(); string password = HttpContext.Request["txtPwd"]; password = FormsAuthentication.HashPasswordForStoringInConfigFile(password, "md5"); G9Service.G9_Service sv = new G9Service.G9_Service(); bool result = sv.KiemTraDangNhap(user, password); if (result) { FormsAuthentication.SetAuthCookie(user, false); RedirectToAction("Index", "Home"); } return View(); }