New to Telerik UI for WinFormsStart a free 30-day trial

Provides utility methods for validating, processing, and handling hyperlinks within Telerik controls.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

C#
public static class HyperlinkHelper

Inheritance: objectHyperlinkHelper

Methods

Displays a warning message box to the user with hyperlink-related information.

C#
public static void ShowMessage(string hyperlink, string message, string caption)
Parameters:hyperlinkstring

The hyperlink that is associated with the message, which will be appended to the message text.

messagestring

The message text to display to the user, typically describing the issue or validation result.

captionstring

The caption text for the message box title bar.

Remarks:

Shows hyperlink-related messages with a warning icon and OK button. The hyperlink parameter is appended to the message text so users can see exactly which link caused the issue.

Validates a hyperlink using regular expression pattern matching to support a broader range of link formats.

C#
public static bool ValidateLinkPattern(string hyperlink)
Parameters:hyperlinkstring

The hyperlink string to validate against the supported patterns.

Returns:

bool

true if the hyperlink matches any of the supported patterns (URL patterns or email patterns); otherwise, false.

Remarks:

This method provides more flexible validation than ValidateLinkScheme(string) by using regular expression patterns to match various hyperlink formats. It supports:

  • HTTP and HTTPS URLs (with or without www prefix)
  • FTP URLs
  • Mailto links
  • UNC paths (\\server\path)
  • OneNote links
  • Web addresses starting with www
  • Email addresses

This validation is more permissive than URI scheme validation and is useful for scenarios where you want to accept a wider variety of link formats, including those that might need preprocessing before being used as actual URLs.

Validates a hyperlink using strict URI scheme validation to ensure it conforms to standard URI formats.

C#
public static bool ValidateLinkScheme(string hyperlink)
Parameters:hyperlinkstring

The hyperlink string to validate.

Returns:

bool

true if the hyperlink is a valid absolute URI with an HTTP, HTTPS, or mailto scheme; otherwise, false.

Remarks:

Performs strict validation using the .NET Uri class. Only accepts URLs with HTTP, HTTPS, or mailto schemes. More restrictive than ValidateLinkPattern and should be used when strict validation is required.