public ActionResult loggetInn(string u, string p) { u = Request.Form["username"]; p = Request.Form["password"]; /*p = CryptoLib.Encryptor.MD5Hash(p + KundeSalt(u)); * Kunde k = KundeID(u, p); * if (k != null) * { * Session["kundeID"] = k.kundeID; * Session["innlogget"] =true; * } * else * { * Session["innlogget"] = null; * return RedirectToAction(""); * } * * return RedirectToAction("visAlleKategorier");*/ var BLL = new KundeBLL(); int kundeID = BLL.loginn(u, p); if (kundeID != 0) { Session["kundeID"] = kundeID; Session["innlogget"] = true; return(RedirectToAction("visAlleKategorier")); } else { Session["innlogget"] = null; return(RedirectToAction("")); } }