I have an ASP.NET 4.5 Web Site project which is using Razor views. This is not an MVC project, it is an empty web site with just a few .cshtml files in it.
I have a form where I want to validate. I found a site here that explains how to do this with a Razor view, but the Validation class does not have the methods shown in the example. I then came across the required
attribute in HTML5, and I added that to each <input>
in my form. This is validating the form when I submit it, but it is using generic error messages like shown in the image:
Here are my questions:
Is there some way to customize these messages?
Is there some way to validate other requirements besides required
- like making sure its a number, or a certain length, etc?
*Note** I am not using MVC, so no models, etc. I also was trying to use something built in to ASP.NET if possible, and not use jQuery Validation directly.
Thanks in advance!