R – SharePoint 2007: Formatting a FormField


I'm trying to display the page owner and last modified date on the footer of a SharePoint master page for a publishing site. On my master page I currently have:

<SharePoint:FormattedString FormatText="Page owner: {0} Last updated: {1:dd/MM/yyyy}" runat="server">
<SharePoint:FormField ControlMode="Display" FieldName="PublishingContact" DisableInputFieldLabel="true" runat="server"/>
<SharePoint:FormField ControlMode="Display" FieldName="Modified" DisableInputFieldLabel="true" runat="server" />

This works great, however it doesn't modify the date format:

Page owner: litwareinc\treesj Last updated: 3/31/2009 10:32 PM

I'm guessing the date is returned as a string so the formatting of dd/MM/yyyy does nothing. I realize modifying the regional settings on the web application might fix this however I'm more interested in how this could be implemeneted with a different format to the default.

Thanks in advance!


Best Solution

You are correct - the FormField control has already rendered the output as a string so wrapping it inside FormattedString won't work.

An alternative to Nat's answer is to write your own control and wrap the FormFields within that. You can then capture the rendered output and transform as you wish.