I have a question regarding the sharepoint on prem. I got a code that get the title of a sharepoint team site using CSOM, more specifically unsing the Title property and show this title in a Episerver page. The problem is that when the administrator of the team site updates the name the module still showing the old name, I understand that is because is reading the Title property that not change if the "display"-name is updated. So my question is how to get the "display"-name so this module send this name instead to Episerver? This is a SharePoint on prem containing several team sites that shows listed in the Episerver page.

Best regards Americo

  • Sorry, but what is EpiServer? Oct 15, 2018 at 11:43
  • can you post your sample code here if no concerns. Title should get the updated Site Title property. Oct 15, 2018 at 11:48

3 Answers 3


This is the method that get all the team sites available and extract following properties: - ID - Title - Url - Description - Members - Administrators - Type

public List<WorkRoom> GetAllAvaliableRooms(string sealedRoomAccountName, string everyoneGroupName, bool loadMembers, string rootSiteUrl)
            List<WorkRoom> result = new List<WorkRoom>();

            SPSecurity.RunWithElevatedPrivileges(delegate ()
                SPSite site = new SPSite(rootSiteUrl);
                SPWebApplication webApplication = site.WebApplication;
                SPSiteCollection siteCollections = webApplication.Sites;

                foreach (SPSite siteCollection in siteCollections)
                    SPWeb rootWeb = siteCollection.RootWeb;

                    if (String.Equals(rootWeb.Url, rootSiteUrl, StringComparison.InvariantCultureIgnoreCase))

                    if (!String.Equals(rootWeb.WebTemplate, TEAM_SITE_TEMPLATE_NAME, StringComparison.InvariantCultureIgnoreCase))

                    var workRoom = new WorkRoom()
                        ID = siteCollection.ID,
                        Title = rootWeb.Title,
                        Url = siteCollection.Url,
                        Description = rootWeb.Description,
                        Members = loadMembers ? WorkRoomHelper.GetMembers(rootWeb) : new List<User>(),
                        Administrators = WorkRoomHelper.GetAdministrators(rootWeb),
                        Type = WorkRoomHelper.GetRoomType(rootWeb, sealedRoomAccountName, everyoneGroupName)


            return result;
        catch (Exception ex)
            throw new FaultException<UnexpectedServiceFault>(new UnexpectedServiceFault()
                ErrorMessage = ex.Message,
                StackTrace = ex.StackTrace,
                FriendlyErrorMessage = "There was an errpr when getting the list of available sites"

Is this helpfull?

Regards Americo


You use SharePoint rest api to get the Title of the web _api/web?$select=Title

 url: "http://<site url>/_api/web?$select=Title",
 type: "GET",
 headers: { "accept": "application/json;odata=verbose" },
 success: function(data){alert(data.d.Title);} ,
 error: function(data){alert('fail');}
  • Firstly, @Americo Perez has coded in CSOM and not REST API. Secondly, the above code will get the Title of the web and not the display name. Oct 15, 2018 at 16:10
  • That could work, my question is how should embed this rest anrop in the metod? and later send the display name to EpiServer? Remember that the metod is using CSOM Oct 15, 2018 at 16:18
  • Can this be the answer? : Feature.DisplayName Oct 15, 2018 at 17:33

Here is an update:

I installed SP on prem in my machineand tested the Title property. I created a team site and called it My Site. In central administration the title property is set to My Site and is the same name that the user see when open the team site. Then I change the name to My Team site by going to the Site settings -> title and description. When I checked in the central administration I noted that the Title property also got updated to My Team site.

But when I do the same test in the scarp SP on prem the title property in the central administration doesn't get updated. Its remain unchanged.

I also added a description text that doesn't show in the central administration either.

Why this is happen? is there some setting that need to be changed in the scarp SP solution?

Best regards Americo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.