This weekend I did some work on an ASP.Net 2.0 project that I've been meaning to devote some time to because it keeps dropping off the list of important things to do. Anyways, as part of it I needed an easy way to allow for user membership with customer profile selections. With the Membership and Profile providers and associated control this was really easy to do.
Then comes step 2 where based on those profiles, at a point in time behind the scenes I need to do a couple of things. Suddenly the quick and easy profile provider maybe didn't seem quite so cool with it's serialization of information for all of the user profile data into a single text field. Fortunately, the whole purpose of the provider is to allow us developers to extend or replace to fit our needs.
Enter the custom profile provider. By simply deriving a class of our own from ProfileProvider we're off to the races. Matthew MacDonald and Mario Szpuszta provide a great example of creating a FactoredProfileProvder in their Apress book Pro ASP.NET 2.0 in c# 2005. Additionally Hao Kung has an ASP.Net 2.0 Table Profile Provider sample up on the ASP.NET site [HERE]. It was great to so easily create a provider that allow me to store everything in seperate database fields and continue as planned.
If I come up with anything fancy I'll post it, otherwise check out their code.