Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenEmailValidator

    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<TItem> 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
    IDisposable
    IRadzenFormValidator
    Inherited Members
    ValidatorBase.messages
    ValidatorBase.SetParametersAsync(ParameterView)
    ValidatorBase.GetComponentCssClass()
    ValidatorBase.Dispose()
    ValidatorBase.BuildRenderTree(RenderTreeBuilder)
    ValidatorBase.Form
    ValidatorBase.Component
    ValidatorBase.Popup
    ValidatorBase.IsValid
    ValidatorBase.EditContext
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.OnContextMenu(MouseEventArgs)
    RadzenComponent.GetCssClass()
    RadzenComponent.GetId()
    RadzenComponent.Debounce(Func<Task>, int)
    RadzenComponent.OnInitialized()
    RadzenComponent.OnAfterRenderAsync(bool)
    RadzenComponent.RaiseContextMenu(MouseEventArgs)
    RadzenComponent.RaiseMouseEnter()
    RadzenComponent.AddContextMenu()
    RadzenComponent.RaiseMouseLeave()
    RadzenComponent.Attributes
    RadzenComponent.Element
    RadzenComponent.MouseEnter
    RadzenComponent.MouseLeave
    RadzenComponent.ContextMenu
    RadzenComponent.Culture
    RadzenComponent.DefaultCulture
    RadzenComponent.Style
    RadzenComponent.Visible
    RadzenComponent.UniqueID
    RadzenComponent.JSRuntime
    RadzenComponent.IsJSRuntimeAvailable
    RadzenComponent.Reference
    RadzenComponent.CurrentStyle
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.StateHasChanged()
    ComponentBase.ShouldRender()
    ComponentBase.OnAfterRender(bool)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.DispatchExceptionAsync(Exception)
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Radzen.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenEmailValidator : ValidatorBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, 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

    RadzenEmailValidator()

    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<TItem> 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()
    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" />

    Properties

    Text

    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
    [Parameter]
    public override string Text { get; set; }
    Property Value
    Type Description
    string

    The validation error message. Default is "Invalid email".

    Overrides
    ValidatorBase.Text

    Methods

    Validate(IRadzenFormComponent)

    Runs validation against the specified component.

    Declaration
    protected override bool Validate(IRadzenFormComponent component)
    Parameters
    Type Name Description
    IRadzenFormComponent component

    The component to validate.

    Returns
    Type Description
    bool

    true if validation is successful, false otherwise.

    Overrides
    ValidatorBase.Validate(IRadzenFormComponent)

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    IRadzenFormValidator

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT