Enum HtmlLinkTargetType

HtmlLinkTargetType enumeration

Represents the type of target attribute in HTML tag.

public enum HtmlLinkTargetType

Values

NameValueDescription
Blank0Opens the linked document in a new window or tab
Parent1Opens the linked document in the parent frame
Self2Opens the linked document in the same frame as it was clicked (this is default)
Top3Opens the linked document in the full body of the window

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using System;

    public class HtmlLinkTargetTypeDemo
    {
        public static void HtmlLinkTargetTypeExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add some data to the worksheet
            worksheet.Cells["A1"].PutValue("Click here to visit Aspose");
            worksheet.Hyperlinks.Add("A1", 1, 1, "https://www.aspose.com");

            // Create HtmlSaveOptions and set the LinkTargetType
            HtmlSaveOptions saveOptions = new HtmlSaveOptions();
            saveOptions.LinkTargetType = HtmlLinkTargetType.Blank; // Opens the link in a new window or tab

            // Save the workbook to HTML format
            workbook.Save("HtmlLinkTargetTypeExample.html", saveOptions);

            Console.WriteLine("HTML file saved with link target type set to '_blank'.");
        }
    }
}

See Also