Examining ASP.NET 2.0's Membership, Roles, and Profile - Part 18

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
http://www.4guysfromrolla.com/articles/120705-1.aspx Membership , in a nutshell, is a framework build into the .NET Framework that supports creating,
authenticating, deleting, and modifying user account information. Each user account has a set of core properties: username, password, email, a security question and
answer, whether or not the account has been approved, whether or not the user is locked out of the system, and so on. These user-specific properties are certainly
helpful, but theyre hardly exhaustive - its not uncommon for an application to need to track additional user-specific properties. For example, an online messageboard
site might want to also also associate a signature, homepage URL, and IM address with each user account.

There are two ways to associate additional information with user accounts when using the Membership model. The first - which affords the greatest flexibility, but
requires the most upfront effort - is to create a custom data store for this information. If you are using the
Code:
SqlMembershipProvider
, this would mean
creating an additional database table that had as a primary key the UserId value from the
Code:
aspnet_Users
table and columns for each of the additional user
properties. The second option is to use the http://www.4guysfromrolla.com/articles/101106-1.aspx Profile system , which allows additional user-specific
properties to be defined in a configuration file. (See http://www.4guysfromrolla.com/articles/101106-1.aspx Part 6 for an in-depth look at the Profile
system.)

This article explores how to store additional user information in a separate database table. Well see how to allow a signed in user to update these additional user-specific
properties and how to create a page to display information about a selected user. Whats more, well look at using http://www.4guysfromrolla.com/articles/012710-1.aspx ASP.NET
Routing to display user information using an SEO-friendly, human-readable URL like
Code:
www.yoursite.com/Users/<i>username</i>
. Read on to learn more!

http://www.4guysfromrolla.com/articles/110310-1.aspx" class="readmore Read More >

View the full article
 
Back
Top