NetcodeHub.Packages.Components.OnPageLoadValidation
1.0.0
dotnet add package NetcodeHub.Packages.Components.OnPageLoadValidation --version 1.0.0
NuGet\Install-Package NetcodeHub.Packages.Components.OnPageLoadValidation -Version 1.0.0
<PackageReference Include="NetcodeHub.Packages.Components.OnPageLoadValidation" Version="1.0.0" />
paket add NetcodeHub.Packages.Components.OnPageLoadValidation --version 1.0.0
#r "nuget: NetcodeHub.Packages.Components.OnPageLoadValidation, 1.0.0"
// Install NetcodeHub.Packages.Components.OnPageLoadValidation as a Cake Addin #addin nuget:?package=NetcodeHub.Packages.Components.OnPageLoadValidation&version=1.0.0 // Install NetcodeHub.Packages.Components.OnPageLoadValidation as a Cake Tool #tool nuget:?package=NetcodeHub.Packages.Components.OnPageLoadValidation&version=1.0.0
How to Use The Package
Install the package
NetcodeHub.Packages.Components.OnPageLoadValidation
Start Using in Editform to Enforce its Validation on Page Startup
<h1>Default Blazor Components</h1>
<EditForm Model="ProductModel" OnValidSubmit="SaveProduct">
<DataAnnotationsValidator />
<ValidationSummary/>
<NetcodeHub.Packages.Components.OnPageLoadValidation.NetcodeHubEditFormValidatorOnPageLoad />
<div class="mt-3">
<label class="form-label">Name</label>
<InputText @bind-Value="ProductModel.Name" class="form-control" />
<ValidationMessage For="() => ProductModel.Name" />
</div>
<div class="mt-3">
<label class="form-label">Quantity</label>
<InputNumber @bind-Value="ProductModel.Quantity" class="form-control" />
<ValidationMessage For="() => ProductModel.Quantity" />
</div>
<div class="mt-3">
<label class="form-label">Description</label>
<InputTextArea @bind-Value="ProductModel.Description" class="form-control" />
<ValidationMessage For="() => ProductModel.Description" />
</div>
<button type="submit" class="btn btn-primary mt-3 mb-5">Save</button>
</EditForm>
@code {
Product ProductModel = new();
void SaveProduct()
{
}
public class Product
{
public int Id { get; set; }
[Required, MinLength(5), MaxLength(10)]
public string? Name { get; set; }
[Required, Range(1, 10)]
public int Quantity { get; set; }
[Required, MinLength(5), MaxLength(10)]
public string? Description { get; set; }
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.5)
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 | 146 | 6/23/2024 |
I am excited to announce the release of NetcodeHubEditFormValidatorOnPageLoad, a Blazor component designed to improve your form handling experience.
Features
Automatic Validation: Automatically validates the EditForm when the page loads, ensuring immediate feedback on any validation errors.
Seamless Integration: Easily integrates with existing EditForm components in your Blazor application.
Simplified Code: Minimal code required for setup, making it easy to implement and maintain.
Start using NetcodeHubEditFormValidatorOnPageLoad to enhance the reliability and user experience of your Blazor forms.