0

I had a look at this question, but I am still not clear where to write server validations, whether in aspx.cs or presenter.

Apart from basic validations like required fields, we have business rules such as from date cannot be more than one month prior to today's date. So, where do we write these kind of validations.

We are using ASP.NET custom validation controls to do client side validations.

Community
  • 1
  • 1
Sunny
  • 4,765
  • 5
  • 37
  • 72
  • You can add attributes to your model classes that instruct how properties should be interpreted to in your view classes. These are more like password required 6 chars and username cannot be blank (these are used for client validation). After all the ui validations have been exhausted then alas a post is made in which case you will more than likely need to check and add and ModelState errors to your result if they exist. – Ross Bush Apr 03 '14 at 02:47
  • I think validation via attributes and ModelState is in ASP.NET MVC. I am not sure I can use it in ASP.NET webforms – Sunny Apr 03 '14 at 02:52

0 Answers0