Try our conversational search powered by Generative AI!

Listing Site Members



In one of our project we have a user section in the site. The users can register to the site and create articles, comment on articles.
The users have some additional properties (profile picture, date of birth, etc) in addition to the default ones.

We are implementing this using EPiServerProfile class.

Now the issue we are facing is how and where to display all the profiles in the CMS so that the WebAdmins can moderate them. Is there a built-in way to do this?




Mar 12, 2015 9:30

Hi, Pankaj, 

It should be that this oldie still works, might be that you'll still need some modifications though:

Mar 12, 2015 11:06

Working with user profiles can be quite tricky.

To get a user profile, you could do:

var epiProfile = EPiServerProfile.Get(username)

To get a profile of all users, you would have to get all users first, and then call EPiServerProfile.Get() inside the foreach loop.

Other way around is to call:

var profiles = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All);
foreach (ProfileInfo profile in profiles)
    ProfileBase profileBase = // tricky part: convert ProfileIfo to ProbileBase
    var epiProfile = EPiServerProfile.Wrap(profileBase);

The things get tricky if you have to make profiles searchable. For example, show me all users which are 30-40 years old.

If you don't have to use EPiServerProfile class, I think you'll have more success with creating some custom table and making your own implementation.

Mar 12, 2015 11:37

Hi Dejan, thanks for you input.

Now the question is where and how do I list all these profiles in the CMS. Do I need to create a pagetype for this and add a page based on that page type in the page tree. Then I will list all the profiles in that page.

I want webAdmins to browse through them.


Mar 12, 2015 12:13

Also does EPiServer Community module will be helpfull in the above scenerio?

Mar 12, 2015 12:21

Hi, Pankaj, 

On the link I've sent you, you have the solution that is integrated into admin -> search for users or groups. It's presented by user.

However, if you need an advanced search by profile values, then the best option is to create and admin tool. That's basically a page you can put anything to.

This is a quick and easy example:

Mar 12, 2015 12:47

I don't think installing EPiServer Community just for the sake of this functionality pays off. It's a big solution, with its own membership providers and lots of more functionality you basically don't need. IMO, it would be an overhead.

Mar 12, 2015 12:48

If you just want to see them in admin mode, then you can check the link Marija sent you.
If you need to create your own solution using the code I posted, then you can create a plugin:
This article is for EPiServer 5, but the logic is the same. Things haven't changed much since then :)

If you don't want to create additional tables in epi database, but don't want to use EPiServerProfile either, you can store profile information as EPiServer pages (one page per user profile).
Profile information should be public anyway?

Mar 12, 2015 12:49

EPiServer pages give you the most flexibility.
You can control who can view / edit / administer pages.
You can use the API you're already familiar with (IContentLoader / IContentRepository).
EPiServer pages are indexed by built-in EPi search, if you decide to use EPiFind, even better :) You don't have to hit the database and can do all kind of filtering.
Just make sure you organize them nicely in epi. You don't want to end up with 1 000 pages under a single node :)

Mar 12, 2015 13:18

Thanks Marija and Dejan for your valuable inputs.

I think taking the EpiServer Page route for user profiles make sense.

So as soon as user registers I will register them using MemberShip class as below, and based on the ID I will create an EpiServer page for them.

Membership.CreateUser("username", "password", "email");

Is this what should be done?


Mar 12, 2015 13:28


After you created the user, you should create a profile page, and log-in the user automatically.

FormsAuthentication.SetAuthCookie(username, true);
PrincipalInfo.CurrentPrincipal = PrincipalInfo.CreatePrincipal(username);
Edited, Mar 12, 2015 13:33

I am able to creat the pages for the user, what do you suggests in terms of organizing them in a page tree.

How can I save them under container page type and not under start page.

Mar 12, 2015 16:50

That depends on the number of users.

You can have a container page under start page called Users, and then container pages A, B, C, D, etc. (first letter of the username), and user profile page below.

For example: Start/Users/J/John-Doe

Not long ago, I blogged about something very similar:

I had to import the content as EPiServer pages and use a similar tree structure.

Hope this helps :)

Mar 12, 2015 22:13

I am creating the profile pages for all the users while registration.

I want to save the profile page reference (ContentReference) along with other profile information. I am able to save LinkURL with the lifo but ContentReference gives me an error.


Mar 20, 2015 16:54

Where are you saving that page reference? Can you show us the code?


Mar 20, 2015 16:58

Code below

var profilePage = _contentRepository.GetDefault<UserProfilePage>(initialContainerPage.ContentLink);
            profilePage.Name = registrationInfo.Firstname + " " + registrationInfo.Lastname;

            profilePage.FirstName = registrationInfo.Firstname;
            profilePage.LastName = registrationInfo.Lastname;
            profilePage.UserEmail = registrationInfo.Email;
            profilePage.FBID = registrationInfo.FBID;

            _contentRepository.Save(profilePage, SaveAction.Publish, AccessLevel.NoAccess);

ProfileBase curProfile = ProfileBase.Create(registrationInfo.Email);
                curProfile.SetPropertyValue("FirstName", registrationInfo.Firstname);
                curProfile.SetPropertyValue("LastName", registrationInfo.Lastname);

                curProfile.SetPropertyValue("ProfileLink", profilePage.LinkURL);
Mar 21, 2015 10:44

I've opened web.config, and added the following value inside profile / properties

<profile defaultProvider="DefaultProfileProvider">
        <add name="ProfileLink" type="EPiServer.Core.PageReference, EPiServer"/>

And here's the code for saving /reading the profile link:

var profile = ProfileBase.Create("");

profile.SetPropertyValue("FirstName", "John");
profile.SetPropertyValue("LastName", "Doe");
profile.SetPropertyValue("ProfileLink", ContentReference.StartPage);


var pageReference = profile.GetPropertyValue("ProfileLink") as PageReference;

Instead of PageReference, maybe you could store the seo friendly URL?

But I'm not sure why you need both UserProfilePage and ASP.NET profiles?
You could use the UserProfilePage as a replacement for ASP.NET profile.

Hope this helps :)

Mar 24, 2015 14:01
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.