IHtmlHelper.ValidationSummary(Boolean, String, Object, String) 方法

定義

傳回物件中 ModelStateDictionary 驗證訊息的未排序清單 (< ul > 元素) 。

public:
 Microsoft::AspNetCore::Html::IHtmlContent ^ ValidationSummary(bool excludePropertyErrors, System::String ^ message, System::Object ^ htmlAttributes, System::String ^ tag);
public Microsoft.AspNetCore.Html.IHtmlContent ValidationSummary (bool excludePropertyErrors, string message, object htmlAttributes, string tag);
abstract member ValidationSummary : bool * string * obj * string -> Microsoft.AspNetCore.Html.IHtmlContent
Public Function ValidationSummary (excludePropertyErrors As Boolean, message As String, htmlAttributes As Object, tag As String) As IHtmlContent

參數

excludePropertyErrors
Boolean

如果 true 為 ,則只顯示模型層級錯誤,否則會顯示所有錯誤。

message
String

要與驗證摘要一起顯示的訊息。

htmlAttributes
Object

Object 包含最上層 (< div >) 專案的 HTML 屬性。 或者, IDictionary<TKey,TValue> 包含 HTML 屬性的實例。

tag
String

要包裝 message 在所產生 HTML 中的 標記。 其預設值為 ValidationSummaryMessageElement

傳回

新的 IHtmlContent ,其中包含 < 包裝元素 tag 和 ul > 元素的 < div > 元素。 如果目前的模型有效且用戶端驗證已停用,則為空白 IHtmlContent

適用於