Dela via


DefaultValidationHtmlAttributeProvider.AddValidationAttributes Method

Definition

Adds validation-related HTML attributes to the attributes if client validation is enabled.

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))

Parameters

viewContext
ViewContext

A ViewContext instance for the current scope.

modelExplorer
ModelExplorer

The ModelExplorer for an expression.

attributes
IDictionary<String,String>

The Dictionary<TKey,TValue> to receive the validation attributes. Maps the validation attribute names to their String values. Values must be HTML encoded before they are written to an HTML document or response.

Applies to