Possible to have multiple Profiles in ASP.NET for different users?
- by asple
My application has a few different user types with their own members. For example, I have the student user as well as the teacher user. I authenticate my users through active directory in my custom MembershipProvider's ValidateUser method. While querying AD, I pull out all their relevant information. I'd like to put that information into a Profile, but from what I've read and the examples I've sen, you can only define a single Profile (like so):
<profile defaultProvider="CustomProfileProvider" enabled="true">
<properties>
<add name="YearLevel" type="String" />
<add name="Name" type="String" />
<add name="Age" type="String" />
</properties>
</profile>
The above profile would work for a student, but not for a teacher, who does not have a value for "YearLevel" in AD. Is it possible to have multiple profiles to accomplish this? Or is it easier to add all properties from AD spanning all user types, then in my code, just check what user type they are and then access their specific properties?