Share via


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)

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel := True)> _
Public Overrides Function ToString As String
'Usage
Dim instance As ImageFieldValue
Dim returnValue As String

returnValue = instance.ToString()
[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.

Remarks

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.

Examples

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

Note

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

See also

Reference

ImageFieldValue class

ImageFieldValue members

Microsoft.SharePoint.Publishing.Fields namespace

ImageUrl

Hyperlink()