# EmailValidationRule

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

* [ValidationRule](/api/wisej.web/extenders/validation/wisej.web.validationrule.md)
  * [EmailValidationRule](/api/wisej.web/extenders/validation/wisej.web.emailvalidationrule.md)

Validates email addresses.

{% tabs %}
{% tab title="C#" %}

```csharp
public class EmailValidationRule : ValidationRule
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class EmailValidationRule
    Inherits ValidationRule
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) EmailValidationRule()

Initializes a new instance of [EmailValidationRule](/api/wisej.web/extenders/validation/wisej.web.emailvalidationrule.md).

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) InvalidDomains

[String\[\]](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets a list of invalid domains: i.e. "dropmail.com", "protonmail.com". (Default: `null`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Name

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the name of the validation rule. (Default: `"Email"`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Required

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the control can be empty or its required to have a value. (Default: `False`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ValidDomains

[String\[\]](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets a list of valid domains: i.e. "mycompany.com", "gmail.com", "hotmail.com". (Default: `null`)

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) OnValidating(control)

Validates the *control* using the validation rule.

| Parameter   | Type                                         | Description |
| ----------- | -------------------------------------------- | ----------- |
| **control** | [Control](/api/wisej.web/general/control.md) |             |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the validation is successful; otherwise false.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/extenders/validation/wisej.web.emailvalidationrule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
