ValidationHtmlAttributeProvider.AddValidationAttributes Méthode

Définition

Ajoute des attributs HTML liés à la validation à si la attributes validation du client est activée.

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

Paramètres

viewContext
ViewContext

Un ViewContext instance pour l’étendue actuelle.

modelExplorer
ModelExplorer

ModelExplorer pour une expression.

attributes
IDictionary<String,String>

pour Dictionary<TKey,TValue> recevoir les attributs de validation. Mappe les noms d’attributs de validation à leurs String valeurs. Les valeurs doivent être encodées au format HTML avant d’être écrites dans un document ou une réponse HTML.

Remarques

N’ajoute rien à attributes si la validation côté client est désactivée.

S’applique à