# ValidatorBase Class

Base class of Radzen validator components.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md)
- ValidatorBase

Derived types: [RadzenCompareValidator](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenCompareValidator.md), [RadzenCustomValidator](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenCustomValidator.md), [RadzenDataAnnotationValidator](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenDataAnnotationValidator.md), [RadzenEmailValidator](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenEmailValidator.md), [RadzenLengthValidator](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenLengthValidator.md), [RadzenNumericRangeValidator](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenNumericRangeValidator.md), [RadzenRegexValidator](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenRegexValidator.md), [RadzenRequiredValidator](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenRequiredValidator.md)

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender
- [IRadzenFormValidator](https://blazor.radzen.com/docs/api/Radzen.IRadzenFormValidator.md)

## Syntax

```csharp
public abstract class ValidatorBase : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormValidator
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `protected ValidatorBase()` | Base class of Radzen validator components. |

## Fields

| Field | Type | Description |
|------|------|-------------|
| messages | `Forms.ValidationMessageStore` | Stores the validation messages. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| Component | `string` | Specifies the component which this validator should validate. Must be set to the Name of an existing component. |
| EditContext | `Forms.EditContext` | Provided by the [RadzenTemplateForm<T>](https://blazor.radzen.com/docs/api/Radzen.Blazor.RadzenTemplateForm-1.md) which contains this validator. Used internally. |
| Form | [`IRadzenForm`](https://blazor.radzen.com/docs/api/Radzen.IRadzenForm.md) | Gets or sets the form which contains this validator. |
| IsValid | `bool` | Returns the validity status. |
| Popup | `bool` | Determines if the validator is displayed as a popup or not. Set to false by default. |
| Text | `string` | Specifies the message displayed when the validator is invalid. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `BuildRenderTree(Rendering.RenderTreeBuilder builder)` | `void` |  |
| `Dispose()` | `void` |  |
| `GetComponentCssClass()` | `string` |  |
| `SetParametersAsync(ParameterView parameters)` | `Task` |  |
| `Validate(IRadzenFormComponent component)` | `bool` | Runs validation against the specified component. Parameters: `component`: The component to validate. Returns: true if validation is successful, false otherwise. |

## Inherited Members

- From [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md): AddContextMenu, Attributes, ContextMenu, Culture, CurrentStyle, Debounce, DefaultCulture, DefaultUICulture, Element, GetCssClass, GetId, GetIdAttribute, IsJSRuntimeAvailable, JSRuntime, Localize, MouseEnter, MouseLeave, OnAfterRenderAsync, OnBecameInvisible, OnContextMenu, OnInitialized, OnMouseEnter, OnMouseLeave, RaiseContextMenu, RaiseMouseEnter, RaiseMouseLeave, Reference, Style, UICulture, UniqueID, Visible
- From ComponentBase: Assets, AssignedRenderMode, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnInitializedAsync, OnParametersSet, OnParametersSetAsync, RendererInfo, ShouldRender, StateHasChanged

