Using the ASPNET Identity 2.0 combat in an existing project

Source: Internet
Author: User

Thanks to @lagess's answer: http://q.cnblogs.com/q/68698/

Method One:

1. Install Identity with NuGet.

2. Add a link string:

<add name="defaultconnection" connectionstring="Data source=.\ Sqlexpress;initial CATALOG=SJK; User id=**;p assword=********;  "providername="System.Data.SqlClient "/>

Note: name= "defaultconnection" do not change, otherwise the identity will be error.

Connection string details can be seen: http://msdn.microsoft.com/zh-cn/library/ms254494 (v=vs.110). aspx. There is also a description of the string encryption.

3, add a large pile and the identity of the east, interested can Google a bit.

Method Two:

This is my recommendation, because I am a rookie, take the easy way

1, vs generates a MVC5 project. The project name is the same as your original project, otherwise it will be said during debugging: <%@ application codebehind= "Global.asax.cs" inherits= " Ninthpatternmember.mvcapplication "language=" C #%> is wrong.

2. Running the project will automatically generate an identity-related table in your database.

3, delete its content, scripts folder.

4. Test your project folder into the corresponding folder in MVC5.

OK, you can enjoy the new features brought by identity.

Using the ASPNET Identity 2.0 combat in an existing project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.