FieldCssClassProvider Class

Definition

Supplies CSS class names for form fields to represent their validation state or other state information from an EditContext.

public ref class FieldCssClassProvider
public class FieldCssClassProvider
type FieldCssClassProvider = class
Public Class FieldCssClassProvider
Inheritance
FieldCssClassProvider

Constructors

Name Description
FieldCssClassProvider()

Methods

Name Description
GetFieldCssClass(EditContext, FieldIdentifier)

Gets a string that indicates the status of the specified field as a CSS class. The result is one of "valid", "invalid", "pending", or "faulted", optionally prefixed with "modified " when IsModified(FieldIdentifier) is true.

  • "pending" is emitted while an async validation task registered via AddValidationTask(FieldIdentifier, Task, CancellationTokenSource) is in flight, and supersedes valid/invalid since the outcome is not yet known.
  • "faulted" is emitted when the field's last async validation threw a non-cancellation exception, and supersedes valid/invalid since the infrastructure failed to determine validity.
  • "valid" or "invalid" reflects whether any validation messages exist for the field once no pending or faulted state applies.

Applies to