Share via


ImageFieldValue.OpenHyperlinkInNewWindow property

Gets or sets a Boolean value that determines whether to open an image hyperlink URL in a new window when the link is clicked.

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

Syntax

'Declaration
Public Property OpenHyperlinkInNewWindow As Boolean
    Get
    Set
'Usage
Dim instance As ImageFieldValue
Dim value As Boolean

value = instance.OpenHyperlinkInNewWindow

instance.OpenHyperlinkInNewWindow = value
public bool OpenHyperlinkInNewWindow { get; set; }

Property value

Type: System.Boolean
A Boolean value that determines whether any image hyperlink URL opens in a new window.
If set to True, any image hyperlink URL opens in a new window. Otherwise, set to False.
Default is False.

Remarks

A True value means that a target="_blank" attribute appears on any hyperlink <A> tag in the ToString method output.

Examples

// You can change any of the following data that are set into the ImageFieldValue
private const string NewImageUrl = "/SiteCollectionImages/SampleImage.jpg";
private const string NewHyperlink = "/Pages/SamplePage.aspx";
private const bool NewOpenHyperlinkInNewWindow = true;
private const string NewAlignment = "right";
private const string NewAlternateText = "Sample alternate text for the image";
private const int NewBorderWidth = 4;
private const int NewHeight = 100;
private const int NewWidth = 150;
private const int NewHorizontalSpacing = 10;
private const int NewVerticalSpacing = 15

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