Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <system.web>
  2. <authentication mode="Forms">
  3. <forms loginUrl="~/Home/Login" timeout="30" />
  4. </authentication>
  5. </system.web>
  6.  
  7. public ActionResult LoginUser(string username, string password)
  8. {
  9. if (ConfigurationManager.AppSettings["UserName"] == username && ConfigurationManager.AppSettings["Password"] == password)
  10. {
  11. FormsAuthentication.SetAuthCookie(username, false);
  12.  
  13. return RedirectToAction("Index");
  14. }
  15. return RedirectToAction("Index");
  16. }
  17.  
  18. $("body").on("click", "#loginbutton", function (e) {
  19.  
  20. $("#loginbutton").attr("href", "/loginuser?username=" + $('[user]').attr('user') + "&password=" + $('[pass]').attr('pass'));
  21.  
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement