I just noticed profiles. So if I turn on Profiles as soon as the Membership
is authenticated then the profile is automatically used? Or do I have to
call a method to load the profile separately?
The profile for the logged in user is available automatically. Getting
the profile for other users is a bit tricky but seems to involve using
ProfileCommon, ie:
Dim PC as ProfileCommon = Profile.GetProfile(theusername)
You can add any field you want to the profiles in the system.web
section in web config:
<profile enabled="true">
<properties>
<add name="AttyName" type="System.String" defaultValue="[null]"/>
<add name="StaffID" type="System.String" defaultValue="[null]"/>
<add name="LastName" type="System.String" defaultValue="[null]"/>
<add name="FirstName" type="System.String"defaultValue="[null]"/>
</properties>
</profile>
These fields are available at designtime and runtime by typing, say,
profile.AttyName = "John Smith". Well, in VB that's how it works, I'm
assuming the same in C#. By default the provider is SQLExpress, and
the fields are stored in a table in an MDF in the asp_data
subdirectory of the website.
Your added fields do not get their own columns; instead they are
merged into two columns. One has the name of the fields and the
location of the data in the second column, and the second column has
all the data. Well, almost all the data. I think that certain complex
types are stored in a third (binary) column but I haven't hit that
yet.
You could, naturally, write your on providers as someone else has
mentioned, but so far SQLExpress has worked ok for me.