Hide

YetaWF.Core Package Documentation

Display
Print

YetaWF.Core.Support.HtmlBuilder.AnonymousObjectToHtmlAttributes Method

Converts an anonymous object, a RouteValueDictionary or a Dictionary<string, object> object to a dictionary.

Class: YetaWF.Core.Support.HtmlBuilder
Namespace: YetaWF.Core.Support
Assembly: YetaWF.Core

Syntax

public static IDictionary<string,object?> AnonymousObjectToHtmlAttributes( object? htmlAttributes );

Parameters

htmlAttributes

An anonymous object, a RouteValueDictionary or a Dictionary<string, object> object.

Return Value

Returns a dictionary with the key/values of the provided object htmlAttributes.

Remarks

This is intended for use with HTML attributes that may use different containers (an anonymous object, a RouteValueDictionary or a Dictionary<string, object> object).

If an anonymous object is used, underscore characters (_) are replaced with hyphens (-) in the keys of the specified HTML attributes.

See Also YetaWF.Core.Support.HtmlBuilder ClassYetaWF.Core Overview