J
Jeff
ASP.NET 2.0
This is a generic class
List<Contact> contacts = Contact.GetContacts(profile.UserName);
Every Contact object holds info about a UserName from aspnet_Users. So
Contact.GetContacts selects all users in aspnet_Users (well, it don't select
everytime, it mostly uses cache, so it is fast) and create a Contact object
for each user..... - In addition these Contact objects holds info which
isn't available in MembershipUser, so that's why I'm not using
MembershipUser
PROBLEM:
But now I need the MembershipUser object for every Contact object. I need to
access info about if this user is online and which role he belong to etc...
So I'm thinking like these:
foreach (Contact contact in contacts)
{
MembershipUser usr = MembershipUserCollection[contact.UserName];
}
But I'm not sure this will work. Will
MembershipUserCollection[contact.UserName]; return a MembershipUser?
any suggestions?
Jeff
This is a generic class
List<Contact> contacts = Contact.GetContacts(profile.UserName);
Every Contact object holds info about a UserName from aspnet_Users. So
Contact.GetContacts selects all users in aspnet_Users (well, it don't select
everytime, it mostly uses cache, so it is fast) and create a Contact object
for each user..... - In addition these Contact objects holds info which
isn't available in MembershipUser, so that's why I'm not using
MembershipUser
PROBLEM:
But now I need the MembershipUser object for every Contact object. I need to
access info about if this user is online and which role he belong to etc...
So I'm thinking like these:
foreach (Contact contact in contacts)
{
MembershipUser usr = MembershipUserCollection[contact.UserName];
}
But I'm not sure this will work. Will
MembershipUserCollection[contact.UserName]; return a MembershipUser?
any suggestions?
Jeff