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.
ValidatorBase.SetParametersAsync
ValidatorBase.GetComponentCssClass
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenEmailValidator : ValidatorBase, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormValidatorBasic 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" />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.
public RadzenEmailValidator()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.
public string Text { get; set; }
| Type | Description |
|---|---|
| string | 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. |
protected override bool Validate(IRadzenFormComponent component)
| Type | Name | Description |
|---|---|---|
| IRadzenFormComponent | component |
| Type | Description |
|---|---|
| bool |