Bagikan melalui


DefaultValidationHtmlAttributeProvider.AddValidationAttributes Metode

Definisi

Menambahkan atribut HTML terkait validasi ke attributes jika validasi klien diaktifkan.

public:
 override void AddValidationAttributes(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExplorer ^ modelExplorer, System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ attributes);
public override void AddValidationAttributes (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer modelExplorer, System.Collections.Generic.IDictionary<string,string> attributes);
override this.AddValidationAttributes : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * System.Collections.Generic.IDictionary<string, string> -> unit
Public Overrides Sub AddValidationAttributes (viewContext As ViewContext, modelExplorer As ModelExplorer, attributes As IDictionary(Of String, String))

Parameter

viewContext
ViewContext

Instans ViewContext untuk cakupan saat ini.

modelExplorer
ModelExplorer

ModelExplorer untuk ekspresi.

attributes
IDictionary<String,String>

Dictionary<TKey,TValue> untuk menerima atribut validasi. Memetakan nama atribut validasi ke nilainya String . Nilai harus dikodekan HTML sebelum ditulis ke dokumen atau respons HTML.

Berlaku untuk