ClientValidationRule(String, String) Constructor

Definition

Creates a new rule with the specified name and error message.

public ClientValidationRule(string name, string errorMessage);
new Microsoft.AspNetCore.Components.Forms.ClientValidation.ClientValidationRule : string * string -> Microsoft.AspNetCore.Components.Forms.ClientValidation.ClientValidationRule
Public Sub New (name As String, errorMessage As String)

Parameters

name
String

The rule name. Must be non-empty and must match the name recognized by the client-side validator JavaScript.

errorMessage
String

The formatted error message displayed when the rule fails. Must not be null; pass Empty only if an empty message is intentional.

Applies to