Bagikan melalui


DefaultHtmlGenerator.AddValidationAttributes Metode

Definisi

Menambahkan atribut validasi ke tagBuilder jika validasi klien diaktifkan.

protected:
 virtual void AddValidationAttributes(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, Microsoft::AspNetCore::Mvc::Rendering::TagBuilder ^ tagBuilder, Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExplorer ^ modelExplorer, System::String ^ expression);
protected virtual void AddValidationAttributes (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.Rendering.TagBuilder tagBuilder, Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer modelExplorer, string expression);
abstract member AddValidationAttributes : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.Rendering.TagBuilder * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string -> unit
override this.AddValidationAttributes : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.Rendering.TagBuilder * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string -> unit
Protected Overridable Sub AddValidationAttributes (viewContext As ViewContext, tagBuilder As TagBuilder, modelExplorer As ModelExplorer, expression As String)

Parameter

viewContext
ViewContext

Instans ViewContext untuk cakupan saat ini.

tagBuilder
TagBuilder

Instans TagBuilder.

modelExplorer
ModelExplorer

ModelExplorer untuk expression.

expression
String

Nama ekspresi, relatif terhadap model saat ini.

Berlaku untuk