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
public class PhoneNumberNationalValidationAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute;
PhoneNumberNationalValidationAttribute | Constructor. |
ErrorMessage | Gets or sets an error message to associate with a validation control if validation fails. | |
ErrorMessageResourceName | Gets or sets the error message resource name to use in order to look up the ErrorMessageResourceType property value if validation fails. | |
ErrorMessageResourceType | Gets or sets the resource type to use for error-message lookup if validation fails. | |
RequiresValidationContext | Gets a value that indicates whether the attribute requires validation context. | |
TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. | |
ErrorMessageString | Gets the localized validation error message. |
Equals | Returns a value that indicates whether this instance is equal to a specified object. | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. | |
FormatErrorMessage | Applies formatting to an error message, based on the data field where the error occurred. | |
GetCustomAttribute | Retrieves a custom attribute applied to a specified assembly. Parameters specify the assembly and the type of the custom attribute to search for. | |
GetCustomAttributes | Retrieves an array of the custom attributes applied to an assembly. A parameter specifies the assembly. | |
GetDisplay | Returns a formatted user-displayable phone number (including spaces, parentheses, etc.) | |
GetE164 | Returns a phone number in E164 ISO format. | |
GetHashCode | Returns the hash code for this instance. | |
GetType | Gets the Type of the current instance. | |
GetValidationResult | Checks whether the specified value is valid with respect to the current validation attribute. | |
IsDefaultAttribute | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. | |
IsDefined | Determines whether any custom attributes are applied to an assembly. Parameters specify the assembly, and the type of the custom attribute to search for. | |
IsValid | Determines whether the specified value of the object is valid. | |
Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. | |
MemberwiseClone | Creates a shallow copy of the current Object. | |
ReferenceEquals | Determines whether the specified Object instances are the same instance. | |
ToString | Returns a string that represents the current object. | |
Valid | Returns whether a phone number is a valid (dialable) phone number. | |
Validate | Validates the specified object. |
See Also YetaWF.Core Overview
Documentation Feedback
© 2024 - Softel vdm, Inc. - YetaWF.com