Language

ValidationHtmlAttributeProvider.AddAndTrackValidationAttributes メソッド

定義

クライアント検証が有効で、現在<のフォーム>でattributes検証属性がまだ追加されていない場合は、検証関連の HTML 属性を に追加expressionします。

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

パラメーター

viewContext
ViewContext

現在の ViewContext スコープのインスタンス。

modelExplorer
ModelExplorer

ModelExplorer の expression。

expression
String

現在のモデルを基準とした式名。

attributes
IDictionary<String,String>

Dictionary<TKey,TValue>検証属性を受け取る 。 検証属性の名前を値 String にマップします。 値は、HTML ドキュメントまたは応答に書き込む前に HTML エンコードする必要があります。

注釈

expression重複する検証属性が生成されないように、現在の FormContext 内の を追跡します。 つまり、検証属性は、フォーム>内のこの名前<のフィールドに対して以前の呼び出しで追加されていない場合にのみ追加されます。

適用対象