@Html.ValidationSummary(true) - What's the true do?

后端 未结 1 1501
再見小時候
再見小時候 2020-12-05 19:45

I have code that contains:

@Html.ValidationSummary(true)

I looked at the MSDN site and still can\'t see what setting \"true\" does? What I

相关标签:
1条回答
  • 2020-12-05 20:22

    You can specify error messages against the properties or against the model. Those specified against the model are displayed using the validationsummary().

    The bool property indicates if you would like to display the validation summary error messages at the same time as displaying the property error messages. If you choose not to then the property error messages will be displayed to the user first. Then, when the user has resolved all of those error messages, the summary error messages will be displayed after.

    If the bool parameter is true then only model-level errors are displayed. If the parameter is false then all errors are shown.

    0 讨论(0)
提交回复
热议问题