Is there any mode to use Asp.Net Core client side validation without jquery + jquery validation + jq unobtrusive validation? I mean it's 2017, every browser can handle lots of HTML5 input validators without JavaScript.
The ASP.NET core includes unobtrusive client-side validation libraries, which makes it easier to add client side validation code, without writing a single line of code. In the previous tutorial on server side validation, we looked at how data annotations attributes are used by the Model Validator to validate the Model.
Alternatives to built-in attributes If you need validation not provided by built-in attributes, you can: Create custom attributes. Implement IValidatableObject.
When we talk about ModelState , we mean ModelState property of the ControllerBase abstract class in the Microsoft. AspNetCore. Mvc namespace. It is of ModelStateDictionary type and it represents errors that come from two subsystems: model binding and model validation.
I created a library that is compatible with the original validation library but is much smaller and does not require jQuery. You can use it as a drop-in replacement if you want to reduce payload size of your assets:
https://github.com/kraaden/unobtrusive-validation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With