Im trying to understand the log in form of the MVC default project. I don’t seem to understand where the login credentials (username-password) are saved?? there don’t seem a database for that and what if I want to add a database of username-password-role,
Do I have to change the syntax or just add the database in the model?
Im trying to understand the log in form of the MVC default project.
it depends on the version if you use vs2k13 with the default mvc 5 template it uses entity framework code first which makes a new database for itself, you can find the connectionstring in web.config then you see where this database will be created (app_data
if i’m right)
if you’re using earlier versions you have to prepare an empty database (http://msdn.microsoft.com/en-US/library/ms229862(v=vs.80).aspx)
i hope this helps you a little out
I have found the database, but I want to add a role to the username and password (AspNetUsers table) so that the user will be redirected to the page according to the role can you help me with that?
can’t find where the table AspNetUsers is created
Thanks for your post.
Authentication (Login and Registration) is simple in ASP.NET MVC as the default project template provides all the necessary controller code, model and view to register and login. However adding roles and assigning roles to a particular user please look
at this article below, we will learn all that is related with Roles for a particular user in ASP.NET MVC 4.
#Working with Roles in asp.net mvc4
Hope this can be helpful.