Currently I have a form with a spinedit. This spinedit gets his value by the SpinEditFor functionality. As model type it is an int?. When I submit the form the spinedit wil be submitted. I use an int? instead of an int because I do not want a zero in the spinedit when the value is empty. But when I submit the spinedit with a null value/empty the validation will also not be triggered. Obvious because it is a nullable int. But I like to validate an error when the value is null. Is this somehow possible?
Thank you for your clarification.
If you wish to implement custom model-based validation on the client side, you can create a custom data annotation attribute. Please see the following resources for additional details:
Custom Validation in ASP.NET MVC
GridView - How to perform a custom client side unobtrusive validation for the EditForm template using a custom attribute
Let us know if this approach meets your requirements.