ValidationHtmlAttributeProvider.AddValidationAttributes Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds validation-related HTML attributes to the attributes
if client validation is
enabled.
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))
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.
Remarks
Adds nothing to attributes
if client-side validation is disabled.