HtmlHelper.AnonymousObjectToHtmlAttributes(Object) メソッド

定義

入力オブジェクトから HTML 属性のディクショナリを作成し、各パブリック インスタンス プロパティでアンダースコアをダッシュに変換します。

public:
 static System::Collections::Generic::IDictionary<System::String ^, System::Object ^> ^ AnonymousObjectToHtmlAttributes(System::Object ^ htmlAttributes);
public static System.Collections.Generic.IDictionary<string,object> AnonymousObjectToHtmlAttributes (object htmlAttributes);
static member AnonymousObjectToHtmlAttributes : obj -> System.Collections.Generic.IDictionary<string, obj>
Public Shared Function AnonymousObjectToHtmlAttributes (htmlAttributes As Object) As IDictionary(Of String, Object)

パラメーター

htmlAttributes
Object

HTML 属性を記述する匿名オブジェクト。

戻り値

HTML 属性を表す辞書。

注釈

オブジェクトが既にインスタンスである IDictionary<TKey,TValue> 場合は、浅いコピーが返されます。

new { data_name="value" } は、結果のディクショナリ内のエントリ { "data-name", "value" } に変換されます。

適用対象