简体   繁体   中英

How to use built-in membership in asp.net mvc

I'm using Visual Studio 2015, then i created a new project with authentication of individual users account. I want to use built-in membership (account and manage controller) and manage them in sql server management studio, because i will use (Database First approach) currently i will use them in local server, i will migrate them later to another server.

the most important thing for me right know is managing the database tables from SQL server management studio>

Current Connectionstring:

<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-Niqaaty-20170912110206.mdf;Initial Catalog=aspnet-Niqaaty-20170912110206;Integrated Security=True" providerName="System.Data.SqlClient" />

any suggestion?

just config membership related stuff as same as when you use webform, like db, provide, even login and logout page

then add [Authorize] attribute to your controllers or actions which need to be protected by membership, done

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM