Tag Archives: Data Annotations

ASP.NET Core MVC Ajax Form requests using jquery-unobtrusive

This article shows how to send Ajax requests in an ASP.NET Core MVC application using jquery-unobtrusive. This can be tricky to setup, for example when using a list of data items with forms using the onchange Javascript event, or the oninput event. Code: https://github.com/damienbod/AspNetCoreBootstrap4Validation Setting up the Project The project uses the npm package.json file, […]

Validation in MVC, Enterprise Library, Fluent Validation, Data Annotations, FoolProof

MVC Validation MVC has many possibilities for validation. Depending on the use case, the correct validation should be used. Here is a list of MVC validation possibilities: Server side Model-level validation Server side Property-level validation Client side Model-level validation Server side Property-level validation Server side custom validation When validating, a number of problems can exist […]

Simple MVC Application using standard Validation (DataAnnotations)

This is a simple example of standard MVC validation provided in the .NET framework. Create a new MVC application. Edit the index.cshtml file. Important: for client validation to work, the scripts section must be included. (Defined per default in the _Layout View and the BundleConfig.cs in the App_Start folder) Create a Model Edit the web.config […]