Skip to content

ValidateUrlAttribute class

namespace: Serenity.ComponentModel   assembly: Serenity.Net.Core

Requires a text to be an absolute http, https or ftp address with a host, which the forms also check. It is stricter than UrlAttribute, which only checks how the text starts, and can not be derived from. Like it, it is a DataTypeAttribute of Url, which tools like OpenAPI read. An empty value is valid, as being required is RequiredAttribute's concern.

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public class ValidateUrlAttribute : DataTypeAttribute, IClientValidationRule, IHasTextKey

Public Members

name description
ValidateUrlAttribute() Requires a text to be an absolute http, https or ftp address with a host, which the forms also check. It is stricter than UrlAttribute, which only checks how the text starts, and can not be derived from. Like it, it is a DataTypeAttribute of Url, which tools like OpenAPI read. An empty value is valid, as being required is RequiredAttribute's concern.
Rule { get; }
RuleParams { get; }
Side { get; set; }
TextKey { get; set; }
override IsValid(…)
const Key The type key of the class of the rule on the client side, i.e. Serenity.UrlValidationRule.

Protected Members

name description
override IsValid(…)

See Also