CS4 webControl25

CS4 webControl25

Link25

Link25 is a reusable ASP.NET helper control used to generate HTML anchor elements with optional icons, images, FontAwesome icons, tooltips, popup behavior, and new-tab navigation.

Key Features

  • Standard hyperlink generation
  • Support for Icon25 icons
  • Support for FontAwesome icons
  • Image-based links
  • Popup window support
  • Open link in new tab
  • Tooltip support

Public Enums

LabelSize

ValueDescription
S1 – S5Predefined label sizes
MaxMaximum predefined size
AutoAutomatically adjusted size

LabelColor

ValueDescription
GreenGreen label color
RedRed label color
YellowYellow label color
BlueBlue label color
CyanCyan label color (default)
GreyGrey label color
BlackBlack label color
NoneNo color styling

LabelIconAlign

ValueDescription
LeftIcon displayed to the left of text
RightIcon displayed to the right of text

Properties Class

The Link25.Properties class is used to configure the link before rendering HTML.

PropertyTypeDescription
NamestringText displayed for the link
TargetUrlstringURL to navigate to
IconIcon25.IconCollectionPredefined Icon25 icon
IconSizeIcon25.IconSizeSize of the icon
FontAwesomeIconstringFontAwesome icon class
ImageUrlstringImage URL for image-based links
ImageHeightstringCSS height of the image
ImageWidthstringCSS width of the image
ToolTipstringTooltip text
NewTabboolOpens link in a new browser tab
ShowPopupboolOpens link in a popup window
PopupHeightintPopup window height
PopupWidthintPopup window width
LabelColorLabelColorLabel color styling
LabelSizeLabelSizeLabel size styling
LabelIconAlignLabelIconAlignIcon alignment
BackgroundColorstringCustom background color
ColorColorText color

Sample Code

Basic Text Link

var link = new Link25();
link.AddUrl(new Link25.Properties
{
    Name = "Open Dashboard",
    TargetUrl = "/Dashboard"
});
var html = link.GetHtml();

Link with Icon

link.AddUrl(new Link25.Properties
{
    Name = "Info",
    TargetUrl = "/Info",
    Icon = Icon25.IconCollection.Info,
    IconSize = Icon25.IconSize.S2,
    ToolTip = "More information"
});

Link Opening in New Tab

link.AddUrl(new Link25.Properties
{
    Name = "External Site",
    TargetUrl = "https://example.com",
    NewTab = true
});

Popup Link

link.AddUrl(new Link25.Properties
{
    Name = "Preview",
    TargetUrl = "/Preview",
    ShowPopup = true,
    PopupWidth = 600,
    PopupHeight = 400
});