ProfileBase Create method, not loading properly!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Willer

    #1

    ProfileBase Create method, not loading properly!

    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();
    ProfileInfoColl ection pic =
    ProfileManager. GetAllProfiles( ProfileAuthenti cationOption.Al l);
    IEnumerator ie = pic.GetEnumerat or();
    ie.MoveNext();
    bool asd;
    for (int i = 0; i < pic.Count; i++)
    {
    pb = ProfileBase.Cre ate(((ProfileIn fo)ie.Current). UserName,
    false);
    asd = (bool)pb.GetPro pertyValue("isE nabled");
    ie.MoveNext();
    }

Working...