Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <system.web>
- <authentication mode="Forms">
- <forms loginUrl="~/Home/Login" timeout="30" />
- </authentication>
- </system.web>
- public ActionResult LoginUser(string username, string password)
- {
- if (ConfigurationManager.AppSettings["UserName"] == username && ConfigurationManager.AppSettings["Password"] == password)
- {
- FormsAuthentication.SetAuthCookie(username, false);
- return RedirectToAction("Index");
- }
- return RedirectToAction("Index");
- }
- $("body").on("click", "#loginbutton", function (e) {
- $("#loginbutton").attr("href", "/loginuser?username=" + $('[user]').attr('user') + "&password=" + $('[pass]').attr('pass'));
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement