ASP.NET MVC ValidationSummary For Client Side Validation

后端 未结 3 1279
太阳男子
太阳男子 2021-01-17 02:19

Our server side validation (via data annotations) is working great and posts the errors in our ValidationSummary how we like it. The client side validation also works, howe

3条回答
  •  鱼传尺愫
    2021-01-17 02:32

    If you're talking about using ASP.NET MVC 2 Preview 2 or any other generated client side validation that uses the jQuery Validation library, you should check out errorLabelContainer and errorContainer in the documentation for jQuery Validation library.

    That should get your client side validation looking more like the server side validation summary. :-)

    HTHs,
    Charles

    Ps. If you can't alter the $('myForm').Validate()'s options, just use the $.validator.setDefaults(); approach. Although you could get into trouble with more than one form / validation summary on a page.

提交回复
热议问题