Click here to Skip to main content
15,941,071 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
How can i use membership provider to store user form details in database.
after storing i have to authenticate users for login in different roles.

and also i have to implement on tier architecture

i have search on google here is link which show to download
i do not know what is this[^]
Updated 20-Aug-13 4:14am
Naman Kumar Sinha 20-Aug-13 8:51am    
Can you be more specific as to what exactly you want? Is it a website or web app? You want to implement Membership authentication in Entity Framework site/app ! What do you mean by tier architecture here, are you creating MVC app or is it just a design consideration? As of now since nothing is clear I'll suggest keeping the authentication and business logic separate.
saurabh bhatia1 20-Aug-13 9:22am    
hi sir,
thanks for your reply
it is application
and also it is not mvc
using class library i will make BAL DAL and UI

1 solution

Below article may be helped to understand the ASP.NET default Membership and Role Provider mechanism. Then you just need to replace that membership provider with Entity framework membership provider details as shown bottom of this answer.

ASP.NET default Membership and Role Provider :

ASP.NET Membership and Role Provider[^]

EF membership provider[^][^]

Hence you're using Asp.Net database (aspnet_regsql). you have to replace it with this code:

Open and edit your web.config or app.config. In the system.web section:

<membership defaultprovider="OmidIDMembershipProvider">
            <clear />
            <add name="OmidIDMembershipProvider">
                           [System.Guid]], OmidID.Web.Security.EFMembershipProvider"
                 connectionStringName="ApplicationServices" tablePrefix="aspnet_"
                 enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
                 maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
                 applicationName="/" />

    <rolemanager enabled="true" defaultprovider="OmidIDRoleProvider">
            <clear />
            <add name="OmidIDRoleProvider">
                          [System.Guid]], OmidID.Web.Security.EFMembershipProvider"
              connectionStringName="ApplicationServices" tablePrefix="aspnet_"
              applicationName="/" />

I hope this will help to you.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900