ASP.NET MVC Login through database -


i have code here login, it's working can see, hard coded username , password, database accounts, preferably using raw sql not entity framework, please help.

[httppost] public actionresult login(loginviewmodel login) {     if (!modelstate.isvalid)     {         viewbag.error = "form not valid; please review , try again.";         return view("login");     }      if (login.username == "bpradmin" && login.password == "admin123")         formsauthentication.redirectfromloginpage(login.username, true);      viewbag.error = "credentials invalid. please try again.";     return view("login"); } 

i recommend entity framework. should choose between code first or database first. framework easy understand , can pretty cool things once have understood order of events. link tutorial entity framework http://www.entityframeworktutorial.net/


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -