How to add ASP.NET Membership Provider in a Empty MVC 4 Project Template?

后端 未结 4 811
逝去的感伤
逝去的感伤 2020-12-01 02:36

I am new in ASP.NET MVC4. I am creating a Empty MVC4 Project Template and trying to add ASP.NET Membership Provider into it but i am not understanding how can I do it. I am

4条回答
  •  青春惊慌失措
    2020-12-01 02:48

    Installing it

    You need to add the following Nuget Packages:

    • EntityFramework

    • Microsoft.AspNet.WebPages.OAuth

      Note: This package will install all the required dependencies automatically for you. This is a detailed list of all nuget packages installed:

      • Microsoft.AspNet.WebPages.WebData

        • Microsoft.AspNet.WebPages.Data
      • DotNetOpenAuth.AspNet

        • DotNetOpenAuth.OpenId.RelyingParty

          • DotNetOpenAuth.OpenId.Core

            • DotNetOpenAuth.Core

              • CodeContracts.Unofficial
        • DotNetOpenAuth.OAuth.Consumer

          • DotNetOpenAuth.OAuth.Core

            • DotNetOpenAuth.Core

              • CodeContracts.Unofficial

    Add a reference to

    • System.Transactions

    Testing it

    Now in order to test it, add the following to the web.config file (Under system.web):

    
      
    
    

    Add the following connection string

      
        
      
    

    And what I did was to copy the controllers, models, filters and views from the Internet template and just modify things like the namespace and so on until you get it up and running

    This is the result (without styles)

    Before login

    enter image description here

    Registering

    enter image description here

    Logged IN

    enter image description here

提交回复
热议问题