Class ButtonHtmlAttributesExtensions
Extension methods on HtmlAttributes for the Twitter Bootstrap 3 template.
Inheritance
Inherited Members
Namespace: ChameleonForms.Templates.TwitterBootstrap3
Assembly: ChameleonForms.Templates.dll
Syntax
public static class ButtonHtmlAttributesExtensions
Methods
| Improve this Doc View SourceWithIcon(ButtonHtmlAttributes, String)
Adds the given icon to the start of a navigation button.
Declaration
public static ButtonHtmlAttributes WithIcon(this ButtonHtmlAttributes attrs, string icon)
Parameters
Type | Name | Description |
---|---|---|
ButtonHtmlAttributes | attrs | The Html Attributes from a navigation button |
System.String | icon | The icon to use; see https://getbootstrap.com/docs/3.3/components/#glyphicons |
Returns
Type | Description |
---|---|
ButtonHtmlAttributes | The Html Attribute object so other methods can be chained off of it |
Examples
@n.Submit("Submit").WithIcon("arrow-right") // Output: <button type="submit"><span class="glyphicon glyphicon-arrow-right"></span> Submit</button>
| Improve this Doc View SourceWithSize(ButtonHtmlAttributes, ButtonSize)
Changes the button to use the given size.
Declaration
public static ButtonHtmlAttributes WithSize(this ButtonHtmlAttributes attrs, ButtonSize size)
Parameters
Type | Name | Description |
---|---|---|
ButtonHtmlAttributes | attrs | The Html Attributes from a navigation button |
ButtonSize | size | The size of button |
Returns
Type | Description |
---|---|
ButtonHtmlAttributes | The Html Attribute object so other methods can be chained off of it |
Examples
@n.Submit("Submit").WithSize(ButtonSize.Large)
| Improve this Doc View SourceWithStyle(ButtonHtmlAttributes, EmphasisStyle)
Adds the given emphasis to the button.
Declaration
public static ButtonHtmlAttributes WithStyle(this ButtonHtmlAttributes attrs, EmphasisStyle style)
Parameters
Type | Name | Description |
---|---|---|
ButtonHtmlAttributes | attrs | The Html Attributes from a navigation button |
EmphasisStyle | style | The style of button |
Returns
Type | Description |
---|---|
ButtonHtmlAttributes | The Html Attribute object so other methods can be chained off of it |
Examples
@n.Submit("Submit").WithStyle(EmphasisStyle.Warning)