How to set up a membership provider to insert data into my own database
2 answers
You can create a custom MemberhipProvider to work with a custom authentication system. You have to implement many methods. Here's an example
public class DreemMembershipProvider : MembershipProvider
{
...
public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
//your code to insert a user in the db.
}
public override bool ValidateUser(string username, string password)
{
//your code to check the user and pass against your db
}
...
}
Finally, you need to configure your application to use the membership provider -> in your web.config file
0
a source to share