11.2. The MembershipUser Class
Regardless of whether you code against the static Membership class or directly against MembershipProviders, you will invariable deal with the MembershipUser class. The MembershipUser class is intended to be a lightweight representation of a user (though in retrospect it is just a tad bit too lightweight—hopefully, basic information such as first name, last name, and/or friendly name will be tacked on in a future release). The class is not intended to be an exhaustive or comprehensive representation of everything you would ever want to store about a user.
For ASP.NET 2.0 and ASP.NET 3.5, if you need to store more extensive information about a user, the usual approach is to leverage the Profile feature by defining the additional properties you need within the <profile /> configuration section. Alternatively, you can author a custom provider (perhaps deriving from an existing provider type) that works with a derived version of MembershipUser. Using the Profile feature is definitely the simpler of the two approaches. However, writing a custom provider and custom MembershipUser class is appropriate if you do not want to use the Profile feature in your website. For more about the different approaches used to extend the Membership provider model in ASP.NET 2.0 and ASP.NET 3.5, see the article at http://www.code-magazine.com/Article.aspx?quickid=0703071). It will give you a detailed explanation on how to set up a custom Membership provider that attaches ...
Get Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.