MVC 4 client side validation not working

后端 未结 21 1348
情话喂你
情话喂你 2020-12-02 14:00

Can anyone tell me why client side validation is not working in my MVC 4 application.

_layout.schtml

@Scripts.Render("~/bundles/jquery")
@R         


        
21条回答
  •  悲&欢浪女
    2020-12-02 14:48

    In my case the validation itself was working (I could validate an element and retrieve a correct boolean value), but there was no visual output.

    My fault was that I forgot this line @Html.ValidationMessageFor(m => ...)

    The TS has this in his code and got me on the right track, but I put it in here as reference for others.

提交回复
热议问题