AI OnAI Off
Never mind. I solved it :) kinda obvious. I used the Episerveprofile instead of profileinfo. But not so obvious when you have spend all morning pulling your hair with all kinds of different aproaches heheh :)
List<EPiServerProfile> profiles = new List<EPiServerProfile>();
foreach (EPiServerProfile profile in EPiServerProfile.GetProfiles("IteraUser"))
{
profiles.Add(profile);
}
gridviewer.DataSource = profiles;
gridviewer.DataBind();
Hello!
Im trying to list all the user profiles on my website in a list.
I have registered some users and given them roles who have read rights on my episerver site.
I have successfully printed out some basic profile information in a gridview. However I cant add/print out some more information like FirstName, LatName and so on.
my code:
The viewlist template codebehind in the onload method:
EPiServerProfile.Current.FirstName = "hej";
List<ProfileInfo> profiles = new List<ProfileInfo>();
foreach (ProfileInfo profile in ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All))
{
profiles.Add(profile);
}
gridviewer.DataSource = profiles;
gridviewer.DataBind();
and my template:
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainContent">
<asp:GridView ID="gridviewer" runat="server">
</asp:GridView>
</asp:Content>
It prints out some basic info like username, and latest activity but not my FirstName property.
What am I doing wrong here?