This msdn tutorial guides you on the implementation steps required for implementing a membership provider. An ODBC based sample implementation can be found here. This shows the sample database schema for implementing a membership provider on MS-Access. The corresponding C#/VB.NET code can be found on: How to: Sample Membership Provider Implementation.
I have modified this custom Membership Provider's ODBC implementation for SQL Server. The file can be downloaded from here. This file also contains the custom Create Table SQL for the user table. This membership provider should be saved as .cs file and be placed in the 'App_Code' folder. The web.config file should be configured to use this membership provider. This can be done by adding the following between the <system.web> tags:
<membership defaultProvider="DbMembership">After adding this all the ASP.NET login controls will be used according to the functionality specified in the custom membership provider DbMembership.
<providers>
<add name="DbMembership"
type="DbMembership.DbMembershipProvider"
connectionStringName="SqlConnectionString"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
writeExceptionsToEventLog="true"
applicationName="AFIRS"/>
</providers>
</membership>
No comments:
Post a Comment