ChameleonForms/HtmlAttributes.cs
/// <summary>
/// Adds or updates a HTML attribute with using a lambda method to express the attribute.
/// </summary>
/// <example>
/// h.Attr(style => "width: 100%;")
/// </example>
/// <param name="attribute">A lambda expression representing the attribute to set and its value</param>
/// <returns>The <see cref="HtmlAttributes"/> attribute to allow for method chaining</returns>
Adds or updates a HTML attribute with using a lambda method to express the attribute.
Adds or updates a HTML attribute with using a lambda method to express the attribute .
public HtmlAttributes Attr(Func<object, object> attribute)
        {
            var item = attribute(null);
            _tagBuilder.MergeAttribute(attribute.Method.GetParameters()[0].Name.Replace("_", "-").ToLower(), item == null ? string.Empty : item.ToString(), true);
            return this;
        }
public HtmlAttributes Attr ( Func < object , object > attribute ) { var item = attribute ( null ) ; _tagBuilder . MergeAttribute ( attribute . Method . GetParameters ( ) [ 0 ] . Name . Replace ( " " , " " ) . ToLower ( ) , item == null ? string . Empty : item . ToString ( ) , true ) ; return this ; }
Adds or updates a HTML attribute with using a lambda method to express the attribute.
Adds or updates a HTML attribute with using a lambda method to express the attribute .
The  attribute to allow for method chaining
The attribute to allow for method chaining
attribute
Func<object, object>
A lambda expression representing the attribute to set and its value
A lambda expression representing the attribute to set and its value
example
None