Advertisement
Guest User

Untitled

a guest
May 28th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. public ActionResult Login(AccountLog Usr)
  2. {
  3. AccountLog personindatabase = db.AccountLogs.FirstOrDefault(m => m.Usercode == Usr.Usercode);
  4.  
  5. FormsAuthentication.SetAuthCookie(personindatabase.UserName, true);
  6. ViewBag.id = personindatabase.Usersid;
  7. return RedirectToAction("Main", "Main");}
  8.  
  9. public ActionResult Main()
  10. {
  11. if (Request.IsAuthenticated)
  12. {
  13. return View();
  14. }
  15.  
  16. return RedirectToAction("Login", "Account");
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement