Udostępnij za pośrednictwem


HtmlHelper.AnonymousObjectToHtmlAttributes(Object) Metoda

Definicja

Tworzy słownik atrybutów HTML z obiektu wejściowego, tłumacząc podkreślenia na kreski w każdej właściwości wystąpienia publicznego.

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)

Parametry

htmlAttributes
Object

Anonimowy obiekt opisujący atrybuty HTML.

Zwraca

Słownik reprezentujący atrybuty HTML.

Uwagi

Jeśli obiekt jest już wystąpieniem IDictionary<TKey,TValue> , zwracana jest płytkia kopia.

new { data_name="value" } spowoduje tłumaczenie na wpis { "data-name", "value" } w wynikowym słowniku.

Dotyczy