1

I have created the SharePoint custom page called "Finance.aspx".I have changed the page title as 'Finance page'.i need to the current page title from page properties using c# code.

please suggest any idea to get the page properties using c#.

1

First add Microsoft.SharePoint.Publishing; reference to your solution

 SPWeb web = SPContext.Current.Web;
 PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
 PublishingPageCollection pages = publishingWeb.GetPublishingPages();
            foreach (var page in pages)
            {
                if (page.Name == "your page name")
                {
                    string title = page.Title;
                    string desc = page.Description;
                    string createdBy = page.CreatedBy.ToString();
                }

            }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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