Hide

YetaWF.Core Package Documentation

Display
Print

YetaWF.Core.Models.Attributes.PhoneNumberNationalValidationAttribute Class

Validates any national phone number. Only phone numbers of the site's defined country are considered valid.

It uses the country defined in site settings (Site Settings, Site, Country property) as the current (national) country and allows entry of national numbers without country code. International numbers are not handled.

Examples of valid numbers (assuming US is the current country): (407) 555-1212 4075551212 +14075551212 (includes country code)

Namespace: YetaWF.Core.Models.Attributes
Assembly: YetaWF.Core

Inheritance

Syntax

public class PhoneNumberNationalValidationAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute;

Constructors

PublicPhoneNumberNationalValidationAttributeConstructor.

Properties

PublicInherited from System.ComponentModel.DataAnnotations.ValidationAttributeErrorMessageGets or sets an error message to associate with a validation control if validation fails.
PublicInherited from System.ComponentModel.DataAnnotations.ValidationAttributeErrorMessageResourceNameGets or sets the error message resource name to use in order to look up the ErrorMessageResourceType property value if validation fails.
PublicInherited from System.ComponentModel.DataAnnotations.ValidationAttributeErrorMessageResourceTypeGets or sets the resource type to use for error-message lookup if validation fails.
PublicInherited from System.ComponentModel.DataAnnotations.ValidationAttributeRequiresValidationContextGets a value that indicates whether the attribute requires validation context.
PublicInherited from System.AttributeTypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
ProtectedInherited from System.ComponentModel.DataAnnotations.ValidationAttributeErrorMessageStringGets the localized validation error message.

Methods

PublicInherited from System.AttributeEqualsReturns a value that indicates whether this instance is equal to a specified object.
ProtectedInherited from System.ObjectFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
PublicInherited from System.ComponentModel.DataAnnotations.ValidationAttributeFormatErrorMessageApplies formatting to an error message, based on the data field where the error occurred.
PublicStaticInherited from System.AttributeGetCustomAttributeRetrieves a custom attribute applied to a specified assembly. Parameters specify the assembly and the type of the custom attribute to search for.
PublicStaticInherited from System.AttributeGetCustomAttributesRetrieves an array of the custom attributes applied to an assembly. A parameter specifies the assembly.
PublicStaticGetDisplayReturns a formatted user-displayable phone number (including spaces, parentheses, etc.)
PublicStaticGetE164Returns a phone number in E164 ISO format.
PublicInherited from System.AttributeGetHashCodeReturns the hash code for this instance.
PublicInherited from System.ObjectGetTypeGets the Type of the current instance.
PublicInherited from System.ComponentModel.DataAnnotations.ValidationAttributeGetValidationResultChecks whether the specified value is valid with respect to the current validation attribute.
PublicInherited from System.AttributeIsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
PublicStaticInherited from System.AttributeIsDefinedDetermines whether any custom attributes are applied to an assembly. Parameters specify the assembly, and the type of the custom attribute to search for.
PublicInherited from System.ComponentModel.DataAnnotations.ValidationAttributeIsValidDetermines whether the specified value of the object is valid.
PublicInherited from System.AttributeMatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
ProtectedInherited from System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
PublicInherited from System.ObjectToStringReturns a string that represents the current object.
PublicStaticValidReturns whether a phone number is a valid (dialable) phone number.
PublicInherited from System.ComponentModel.DataAnnotations.ValidationAttributeValidateValidates the specified object.

See Also YetaWF.Core Overview