1

I am using below code,I have deployed this through a page layout using visual studio and it's working fine in IE but in chrome when page complete its loading date disappears and shows "undefined,undefined",How to fix this?

<%@ Page language="C#"   Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="CustomTag_0" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>


    <PublishingWebControls:LastModifiedIndicator runat="server"/>
1

2 Answers 2

3

try

<SharePointWebControls:DateTimeField FieldName="Modified" runat="server" ControlMode="Display"/>

more details on this link : http://blog.tylerholmes.com/2009/06/free-last-modified-bydate-from.html

In the above link, you will be adding a reference to the Assembly "Microsoft.SharePoint" do change the version of it ( as per your current version of SharePoint)

Also have look at this link: On Sharepoint 2013 how do you show the last modified date on a page layout

3
  • I have already tried this but its behaving same? Commented Jun 7, 2017 at 10:18
  • could you try opening an Incognito window and check the value.? Commented Jun 7, 2017 at 10:44
  • I tried that also but it display same? Commented Jun 7, 2017 at 13:29
1

You can do this by borrowing some code from the built-in Page Layout EnterpriseWiki.aspx.

If you open this layout in SharePoint Designer you can find the control used to display the "Last modified at [date] by [User]" string at the top of each Wiki page:

<SharePoint:FormattedString FormatText="<%$Resources:wss,wikidiff_lastmodifiedby%>" runat="server">
    <SharePoint:FormField id="modifiedFieldCtrl" ControlMode="Display" FieldName="Modified" runat="server" />
    <SharePoint:UserField id="editorFieldCtrl" ControlMode="Display" FieldName="Editor" runat="server" />
</SharePoint:FormattedString>
1
  • Agree with Chris, adding the control is the way to go.
    – YogaPanda
    Commented Feb 6, 2018 at 20:17

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.