Search

ASP.NET 2.0: XML Membership Provider

0 views

ASP.NET ships with a SqlMembershipProvider and a ActiveDirectoryMembershipProvider that makes user authentication and authorization very easy to implement, but for some reason those are the only membership providers provided natively by ASP.NET 2.0. So, what do you do when you don't want or can't use SQL Server or Active Directory for memberships? You have to build a custom membership provider that suits your needs. That's exactly what I faced when I wanted an XML membership provider for a small web project. The only one I could find on the web was a very simple Now you have a membership provider that enables you to make use of the collection of built in authentication controls. You can also interact directly with the provider without using the built in controls. Here's an example of how to create a new user: MembershipCreateStatus status; Membership.Provider.CreateUser("admin", "adminpw", "admin@domain.com", string.Empty, string.Empty, true, "admin", out status); Even though you can access the provider programmatically, nothing beats the simplicity of the built in controls. To start using the XmlMembershipProvider, drag a CreateUserWizard to your webform and let the magic begin. XmlMembershipProvider.zip (3,45 KB) Add to Del.icio.us | Digg | Reddit | Furl Bookmark Murdok: Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

Suggest a Correction

Found an error or have a suggestion? Let us know and we'll review it.

Share this article

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!