1

What are the ways to validate form data (in ASP.NET MVC and C#) such as input fields. I try jquery validator but failed. Are there other ways?

DaveRandom
  • 87,921
  • 11
  • 154
  • 174
Ognjen
  • 1,185
  • 7
  • 23
  • 40

4 Answers4

1

Here are several useful tutorials on ASP.NET MVC validation.

Jacob Mattison
  • 50,258
  • 9
  • 107
  • 126
1

MVC v2 has DataAnnotation Validation Support, see Scott Gu's post on this topic.

Ta01
  • 31,040
  • 13
  • 70
  • 99
  • 1
    You can use DataAnnotation Validation in ASP.NET MVC v1.0 as well. http://www.superexpert.com/blog/archive/2008/09/10/asp-net-mvc-tip-43-use-data-annotation-validators.aspx – Keith Adler Dec 21 '09 at 22:33
  • how validate input field who does not have model function – Ognjen Dec 23 '09 at 01:53
0

ASP.NET MVC 2.0 beta has jQuery validator integrated. Might be worth a look.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
0

I recommend use MVC 2 RC, jQuery and jQuery.validate plugin. How it works you can read on Phil Haack's blog. Please, be careful. Phil wrote article in time of MVC 2 Beta. About issues with implementation on RC you can read here: ASP.NET MVC 2 RC client side validation not working.

Community
  • 1
  • 1
Martin
  • 6,436
  • 1
  • 17
  • 10