CustomValidationControls 1.0.0

dotnet add package CustomValidationControls --version 1.0.0
                    
NuGet\Install-Package CustomValidationControls -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CustomValidationControls" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CustomValidationControls" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CustomValidationControls" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CustomValidationControls --version 1.0.0
                    
#r "nuget: CustomValidationControls, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CustomValidationControls@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CustomValidationControls&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CustomValidationControls&version=1.0.0
                    
Install as a Cake Tool

Custom Validation Controls

This NuGet package contains custom ASP.NET validation controls for:

  • Phone number validation
  • Email address validation

Installation

To install the package, use NuGet Package Manager in Visual Studio:

  • Right-click on your project and select Manage NuGet Packages.
  • Search for CustomValidationControls and click Install.

Usage

After installing the package, register the custom validation controls in your ASP.NET Web Forms pages:

<%@ Register TagPrefix="custom" Namespace="CustomValidationControls" Assembly="CustomValidationControls" %>


<form runat="server">
    <div>
        <label for="PhoneNumber">Phone Number:</label>
        <input type="text" id="PhoneNumber" runat="server" />
        <custom:PhoneNumberValidator runat="server" ControlToValidate="PhoneNumber" ErrorMessage="Invalid phone number format." />
    </div>

    <div>
        <label for="Email">Email:</label>
        <input type="text" id="Email" runat="server" />
        <custom:EmailValidator runat="server" ControlToValidate="Email" ErrorMessage="Invalid email format." />
    </div>
</form>

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 219 1/26/2025

- Initial release with custom validation controls for phone numbers and email addresses.
- PhoneNumberValidator: Validates phone numbers with optional international code and various formats.
- EmailValidator: Validates email addresses with a standard format check.
- Both validators skip validation if the input is empty, useful for optional fields.