Argentini.Halide.H3Identify.Validate C# (CSharp) 메소드

Validate() 공개 정적인 메소드

Run data type and field length validation on a specific value. Certain types of validators obviate the need to specify a minimum or maximum length, like ValidationOptions.Email. using Argentini.Halide; ... string result = H3Identify.Validate( value, H3Identify.ValidationOptions.Email);

A common practice is to add error message fields underneath each of your form fields, and then use a single line to validate the input and display the error on the form, as well as set a global flag that identifies that there has been an error.

using Argentini.Halide; ... errorFlag += EmailFieldErrorMessage.InnerHtml = H3Identify.Validate( EmailField.Value, H3Identify.ValidationOptions.Email);

In this way, you can check "errorFlag" to see if it's empty or null, in which case, there were no validation errors, otherwise, you know one or more validations failed. And in the same line, the error message for each field is filled with the error message, since ValidateItem() returns an empty string if the validation is successful, or a friendly error string if it fails.

public static Validate ( string value, ValidationOptions valType ) : String
value string Value to validate.
valType ValidationOptions Constant determining what type of validation.
리턴 String
        public static String Validate(string value, ValidationOptions valType)
        {
            return Validate(value, valType, 0, 0, false);
        }

Same methods

H3Identify::Validate ( string value, ValidationOptions valType, System.Boolean opt ) : String
H3Identify::Validate ( string value, ValidationOptions valType, int minLength, int maxLength ) : String
H3Identify::Validate ( string value, ValidationOptions valType, int minLength, int maxLength, System.Boolean opt ) : String
H3Identify::Validate ( string value, int minLength, int maxLength ) : String
H3Identify::Validate ( string value, string valueList, string delimitters, string errorMsg, System.Boolean useCase ) : String