Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ImageFieldValue.ToString Method

Returns an HTML string with an <IMG> tag with properties as they are currently set in this object.

Namespace:  Microsoft.SharePoint.Publishing.Fields
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
public override string ToString()

Return Value

Type: System.String
An HTML string with an <IMG> tag with properties as they are currently set in this object.

If the ImageUrl property does not have a value, this method returns an empty string. Otherwise, this method returns an HTML string that contains an <IMG> tag, possibly enclosed in an <A> tag hyperlink, depending on the values of the Hyperlink property. Only certain properties are recognized on the <A> and <IMG> tags and used to generate the HTML string.

// The ToString() returns the HTML that reflects the new
// ImageFieldValue properties.
return currentFieldValue.ToString()
NoteNote

This example is part of the larger ImageFieldValue sample in the ImageFieldValue topic.

Show:
© 2015 Microsoft