MVC Razor Validation Errors showing on page load when no data has been posted

前端 未结 4 1489
暖寄归人
暖寄归人 2020-12-09 16:03

I\'m messing around with data annotations. When I click on a link to go to a page, the validation messages are being displayed, but I would like to have the validation messa

4条回答
  •  余生分开走
    2020-12-09 16:46

    Set the validation style to:

    .validation-summary-valid { display:none; }
    

    So by default it's hidden. An error will trigger it to display.

提交回复
热议问题