1

I am using the following code to get page title of current page in Page Layout but it is not working.

<asp:Literal runat="server" text="<%$SPContext.Current.Item['Title']%>"></asp:Literal>

How to get page title in page layout?

2 Answers 2

2

Working on the client, no matter how mysteriously the HTML page's title was originally composed (if that's what you want):

<html>
  ...
  The title of the document is:
  <script type="text/javascript">
    document.write(document.title);
  </script>
  ...
</html>

see: http://www.w3schools.com/jsref/prop_doc_title.asp

1
  • 1
    document.title prints the space - page name here. I use <script>document.write(document.getElementById("ctl00_PlaceHolderMain_wikiPageNameDisplay").innerHTML);</script>
    – Underverse
    Aug 18, 2015 at 8:18
0

What you need us the SharePointWebControl:TextField or SharePointWebControl:FieldProperty control.

Waldek has written a blog about it here: http://blog.mastykarz.nl/showing-names-site-columns-page-layout/#

1
  • Ok I will have a look at it tomorrow morning. Aug 3, 2013 at 17:41

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.