ProfileBase Create method, not loading properly!

W

Willer

I am having a strange problem and I hope you guys can help me out here.

I have a web page which stores user info in a database. The user info
is defined in my web.config file and consists of (this is my
ProfileCommon):
. User Name
. First Name
. Last Name
. Email
. Last Visited
. isEnabled - this tells me whether a user is allowed to enter the web
site or not

I load all user information from all users using
ProfileManager.getAllProfiles. Then I load each user in to a
ProfileBase (using the Create function), so I can check whether the
user is "enabled" or not. But here is where the problem lies. I
retrieve the info from the database fine, but for some reason the
property values do not load to my Profile Base, but the ProfileCommon
object loads fine. The funny part is that when I am debugging the code,
the user properties will load to the ProfileBase if I inspect my
ProfileBase variable.

Also I am unable to use ProfileCommon because, the code is setup as
windows service and I have to access the user info from outside the web
page.

I hope you guys can help. If I wasn't clear enough give me feedback,
because I've never seen such a thing, I might not be explaining it
properly.

Thanks,
Willer

Here it is my code:

ProfileBase pb = new ProfileBase();
ProfileInfoCollection pic =
ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All);
IEnumerator ie = pic.GetEnumerator();
ie.MoveNext();
bool asd;
for (int i = 0; i < pic.Count; i++)
{
pb = ProfileBase.Create(((ProfileInfo)ie.Current).UserName,
false);
asd = (bool)pb.GetPropertyValue("isEnabled");
ie.MoveNext();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top