@ Html.ValidationSummary(真) - 什么是真正的做? [英] @Html.ValidationSummary(true) - What's the true do?

查看:110
本文介绍了@ Html.ValidationSummary(真) - 什么是真正的做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有code包含:

@Html.ValidationSummary(true)

我看了看MSDN网站仍然不能看到什么设置真呢?我注意到的是,当我有是字段的验证消息,则它仍然会创建一个验证摘要DIV那是空的。

I looked at the MSDN site and still can't see what setting "true" does? What I notice is that when I have validation messages that are for fields then it still creates a validation summary DIV that's empty.

有没有办法来苏preSS总结的DIV的创建当例如我场是一个重复的,他们没有表现出任何东西。

Is there a way to supress the creating of the summary DIVs as they don't show anything when for example my field is a duplicate.

推荐答案

您可以指定对属性或对模型的错误消息。反对的模型中指定使用在ValidationSummary()显示。

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.

这篇关于@ Html.ValidationSummary(真) - 什么是真正的做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆