Class UrlValidationRule
Validates whether field value is a valid absolute URL or a relative URL.
[ValidationRuleAttribute(typeof(UrlValidationRuleAttribute))]
public sealed class UrlValidationRule : ValidationRule<UrlValidationRuleProperties, string>, IValidationRule
- Inheritance
-
objectUrlValidationRule
- Implements
- Inherited Members
- Extension Methods
Constructors
UrlValidationRule(ILocalizationService)
Creates a new instance of UrlValidationRule class.
public UrlValidationRule(ILocalizationService localizationService)
Parameters
localizationService
ILocalizationService
Properties
DefaultErrorMessage
Defines default error message of the validation rule.
protected override string DefaultErrorMessage { get; }
Property Value
- string
Methods
Validate(string, IFormFieldValueProvider)
Validates whether value
is a valid absolute URL or a relative URL.
public override Task<ValidationResult> Validate(string value, IFormFieldValueProvider formFieldValueProvider)
Parameters
value
stringValue to be validated.
formFieldValueProvider
IFormFieldValueProviderProvider of values of other form fields for contextual validation.
Returns
- Task<ValidationResult>
Returns the validation result.