Skip to content
Form and Validation Helper for ASP.NET Core. (Compatible with Fluent Validation)
JavaScript C#
Branch: master
Clone or download
Latest commit 43920a8 Oct 12, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Merge branch '2.x' Aug 2, 2019
sample/FormHelper.Samples Added NetCore 3.0 Support Sep 20, 2019
src License info updated. Sep 23, 2019
.gitattributes First push, hello github :) May 5, 2019
.gitignore First push, hello github :) May 5, 2019
Changelog.txt Update Changelog.txt Jul 18, 2019
FormHelper.sln Added embeded script file. Aug 2, 2019
License.txt License info updated. Sep 23, 2019 Update Oct 12, 2019

Form Helper

Form & Validation Helper for ASP.NET Core

Form Helper helps you to create ajax forms and validations without writing any javascript code. It transforms server-side validations to client-side. You can also use the form validator without ajax.

Compatible with Fluent Validation (You can add client-side validation support to Fluent Validation.)

NuGet Nuget



FormHelper can be installed using the Nuget Package Manager or the dotnet CLI.

Package Manager:

Install-Package FormHelper

dotnet CLI:

dotnet add package FormHelper

This library depends on some packages:


// css
<link rel="stylesheet" href="" />

// js
<script src="//"></script>
<script src="//"></script>
<script src="//"></script>

<!-- form helper - You don't need to add this file to your project, just add it. it's embeded! -->
<script src="/formhelper/formhelper.min.js"></script>





With configuration: (optional)

services.AddFormHelper(new FormHelperConfiguration
    CheckTheFormFieldsMessage = "Your custom message...",
    RedirectDelay = 6000


<!-- If you want to use embeded form helper script file, add this line -->


@using FormHelper
@addTagHelper *, FormHelper

View: (TagHelper)

<form asp-formhelper="true" asp-controller="Home" asp-action="Save">
   // <input...
   // ...

// You can use <form asp-formhelper="true"> or <formhelper> to activate formhelper.
// Optional parameters:
// asp-callback="...", asp-beforeSubmit="...", asp-dataType="FormData/Json", asp-enableButtonAfterSuccess="False"


[HttpPost, FormValidator]
public IActionResult Save(FormViewModel viewModel)

// If you use Json data type, you need to add [FromBody] attribute.
// public IActionResult Save([FromBody]FormViewModel viewModel)

Return a result from Controller:

Error Message:

return FormResult.CreateErrorResult("An error occured.");

Success Message:

return FormResult.CreateSuccessResult("Product saved.");

Success Message with Redirect:

return FormResult.CreateSuccessResult("Product saved. Please wait...", Url.Action("Home", "Index"));

Success Message with Redirect and Delay Time:

return FormResult.CreateSuccessResult("Product saved. Please wait...", Url.Action("Home", "Index"), 10000); // 10 seconds
You can’t perform that action at this time.