@Lawrence,
The API that Dmitry referenced is this:
//
// Summary:
// Provides an interface for retrieving the page attachment URL based on given parameters.
public interface IPageAttachmentUrlRetriever
{
//
// Summary:
// Retrieves the page attachment URL representation for given page attachment.
//
// Parameters:
// attachment:
// Page attachment.
IPageAttachmentUrl Retrieve(IAttachment attachment);
}
It requires an IAttachment
. If you pass the Page Type property accessed through the nested .Fields
class, then you will be given a DocumentAttachment
, however if you use the Page Type field directly off the Page Type instance, it will be a Guid
.
I'm guessing you used the wrong property.
Example:
DocumentAttachment attachment = homePage.Fields.Image;
Guid attachmentGuid = homePage.HomePageImage;