LinkFieldValue.Target Property
Gets or sets the target window of the hyperlink value.
Namespace: Microsoft.SharePoint.Publishing.Fields
Assembly: Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
Syntax
'Declaration
Public Property Target As String
Get
Set
'Usage
Dim instance As LinkFieldValue
Dim value As String
value = instance.Target
instance.Target = value
public string Target { get; set; }
Property Value
Type: System.String
Either the target window or frame that displays the Web page content that is linked to when the link is clicked, or an empty string.
Empty string is the default.
Remarks
The target name can be any window target, but only the _blank value that indicates a new window is kept when the value is stored in a SPListItem field value.
Examples
// You can change any of the following data that will be set into the LinkFieldValue.
private const string Newhref = "/Documents/SampleFile.docx";
private const bool NewUseDefaultIcon = false;
private const string NewTarget = "_blank";
private const string NewToolTip = "Sample tool tip for the link";
private const string NewTextPrefix = "Open [";
private const string NewTextSuffix = "] in a new window";
Note
This example is part of the larger LinkFieldValue sample in the LinkFieldValue topic.