/// <summary> /// Creates a Zurb Foundation button /// </summary> /// <param name="html">The current HtmlHelper instance</param> /// <param name="value">The button text</param> /// <param name="id">The button id</param> /// <param name="type"> The type of button to create </param> /// <param name="size"> The button size </param> /// <param name="color">The button color</param> /// <param name="style">The button style</param> /// <param name="cssClass">Any additional css classes</param> public static MvcHtmlString ZurbButton(this HtmlHelper html, string value, string id, ButtonType type, ZurbSize size, ZurbColor color, ButtonStyle style, string cssClass) { return new MvcHtmlString(String.Format("<input type=\"{0}\" value=\"{1}\" class=\"{2} {3} {4} {5} button\" id=\"{6}\" />", type.GetStringValue(), value, size.GetStringValue(), color.GetStringValue(), style.GetStringValue(), cssClass, id)); }
/// <summary> /// Creates a Zurb Foundation button /// </summary> /// <param name="html">The current HtmlHelper instance</param> /// <param name="value">The button text</param> /// <param name="id">The button id</param> /// <param name="type"> The type of button to create </param> /// <param name="size"> The button size </param> /// <param name="color">The button color</param> /// <param name="style">The button style</param> public static MvcHtmlString ZurbButton(this HtmlHelper html, string value, string id, ButtonType type, ZurbSize size, ZurbColor color, ButtonStyle style) { return ZurbButton(html, value, id, type, size, color, style, String.Empty); }
public static HtmlString ZurbSubmit(this HtmlHelper h, string linkText, object htmlAttributes = null, ZurbSize size = ZurbSize.Default, ZurbColor color = ZurbColor.Default) { /* attributes */ IDictionary<string, object> attributes = new RouteValueDictionary(); if (htmlAttributes != null) { attributes = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes); } if (size != ZurbSize.Default) { AddClassToAttributes(attributes, size.ToString().ToLower()); } if (color != ZurbColor.Default) { AddClassToAttributes(attributes, color.ToString().ToLower()); } AddClassToAttributes(attributes, "button"); AddClassToAttributes(attributes, "radius"); return new HtmlString(string.Format("<button type=\"submit\" {0}>{1}</button>", AttributesToString(attributes), linkText)); }