RadzenEmailValidator Class

A validator component that verifies whether a text input contains a valid email address format. RadzenEmailValidator uses the .NET EmailAddressAttribute to validate email format according to standard rules. Must be placed inside a RadzenTemplateForm<T> and associated with a named input component. Checks email format using System.ComponentModel.DataAnnotations.EmailAddressAttribute validation rules. Empty or null values are considered valid - combine with RadzenRequiredValidator to ensure the field is not empty. The validation runs when the form is submitted or when the component loses focus.

Inheritance

Object

ComponentBase

RadzenComponent

ValidatorBase

RadzenEmailValidator

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormValidator

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenEmailValidator : ValidatorBase, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormValidator

Examples

Basic email validation:

<RadzenTemplateForm TItem="Model" Data=@model>
  <RadzenTextBox style="display: block" Name="Email" @bind-Value=@model.Email />
  <RadzenEmailValidator Component="Email" Text="Please enter a valid email address" Style="position: absolute" />
</RadzenTemplateForm>
@code {
 class Model
  {
   public string Email { get; set; }
 }

 Model model = new Model();
}

Combined with required validator:

<RadzenTextBox Name="Email" @bind-Value=@model.Email />
<RadzenRequiredValidator Component="Email" Text="Email is required" />
<RadzenEmailValidator Component="Email" Text="Invalid email format" />

Constructors

RadzenEmailValidatorlink

A validator component that verifies whether a text input contains a valid email address format. RadzenEmailValidator uses the .NET EmailAddressAttribute to validate email format according to standard rules. Must be placed inside a RadzenTemplateForm<T> and associated with a named input component. Checks email format using System.ComponentModel.DataAnnotations.EmailAddressAttribute validation rules. Empty or null values are considered valid - combine with RadzenRequiredValidator to ensure the field is not empty. The validation runs when the form is submitted or when the component loses focus.

Declaration
public RadzenEmailValidator()

Properties

Textlink

Gets or sets the error message displayed when the email address format is invalid. Customize this message to provide clear feedback to users about the expected email format.

Declaration
public string Text { get; set; }
Property Value
Type Description
stringGets or sets the error message displayed when the email address format is invalid. Customize this message to provide clear feedback to users about the expected email format.

Methods

Validatelink

Declaration
protected override bool Validate(IRadzenFormComponent component)
Parameters
Type Name Description
IRadzenFormComponent component
Returns
Type Description
bool
An error has occurred. This app may no longer respond until reloaded. Reload 🗙