How can I stop SharePoint from appending <mso:CustomDocumentProperties> to my output

Posted by tath.am on Stack Overflow See other posts from Stack Overflow or by tath.am
Published on 2010-05-04T04:36:59Z Indexed on 2010/05/04 4:48 UTC
Read the original article Hit count: 448

Filed under:

I'm trying to hack together an extra feature on top of a POC (smoke and mirrors demo). The POC is on SPS 2007 and I need to integrate with another system.

To facilitate part of this, I need to provide a JSONP endpoint.

I want this URL:

http://sharepoint:2024/Pages/SomeExternalSystem/Payload.aspx?callback=abc

To return this:

abc({ sampleField1: "sampleData1", sampleField2: 234.56 });

It's all smoke and mirrors anyway, so I uploaded this file to SharePoint:

<%@ Page ContentType="text/javascript" Language="C#" %>
<%= Request.QueryString["callback"] %>({
  sampleField1: "sampleData1",
  sampleField2: 234.56
});

(And added a page parser rule to allow it to compile the code blocks.)

No matter what I seem to do, SharePoint emits this instead:

abc({
    sampleField1: "sampleData1",
    sampleField2: 234.56
});
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head>
<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:PublishingContactPicture msdt:dt="string"></mso:PublishingContactPicture>
<mso:PublishingRollupImage msdt:dt="string"></mso:PublishingRollupImage>
<mso:Audience msdt:dt="string"></mso:Audience>
<mso:PublishingContactName msdt:dt="string"></mso:PublishingContactName>
<mso:ContentType msdt:dt="string">Page</mso:ContentType>
<mso:Comments msdt:dt="string"></mso:Comments>
<mso:PublishingContactEmail msdt:dt="string"></mso:PublishingContactEmail>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</head>

It's proving hard to Google for.

© Stack Overflow or respective owner

Related posts about sharepoint2007