C# Class RegularExpressionAttribute, i18N-Complete

i18N localized version of System.ComponentModel.DataAnnotations.RegularExpressionAttribute class.

Specifies that a data field value in ASP.NET Dynamic Data must match the specified regular expression.

Inheritance: System.ComponentModel.DataAnnotations.RegularExpressionAttribute
ファイルを表示 Open project: adaptabi/i18N-Complete Class Usage Examples

Public Methods

Method Description
FormatErrorMessage ( string name ) : string

Formats the error message to display if the regular expression validation fails.

RegularExpressionAttribute ( string pattern ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.RegularExpressionAttribute class whose error message is localized.

ErrorMessage is set to:

The field {0} must match the regular expression '{1}'.

RegularExpressionAttribute ( string errorMessage, string pattern ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.RegularExpressionAttribute class whose error message is localized.

Method Details

FormatErrorMessage() public method

Formats the error message to display if the regular expression validation fails.
public FormatErrorMessage ( string name ) : string
name string The name of the field that caused the validation failure.
return string

RegularExpressionAttribute() public method

Initializes a new instance of the System.ComponentModel.DataAnnotations.RegularExpressionAttribute class whose error message is localized.

ErrorMessage is set to:

The field {0} must match the regular expression '{1}'.

public RegularExpressionAttribute ( string pattern ) : System
pattern string The regular expression that is used to validate the data field value.
return System

RegularExpressionAttribute() public method

Initializes a new instance of the System.ComponentModel.DataAnnotations.RegularExpressionAttribute class whose error message is localized.
public RegularExpressionAttribute ( string errorMessage, string pattern ) : System
errorMessage string An error message to associate with a validation control if validation fails.
pattern string The regular expression that is used to validate the data field value.
return System