Take me to google Take me to google Take me to google
Special buttons can be created by decorating hyperlinks and basic buttons with the appropriate special button type
Markup
@Html.Hyperlink("Take me to google", "http://www.google.com")
.AsButton(EBootstrapButton.Default)
@Html.Button(EButton.Regular, "Take me to google", "window.location='http://www.google.com.au'")
.AsButton(EBootstrapButton.Danger, EBootstrapButton.Large)
Output
All available extensions
// Note that this extension can only be used for hyperlinks and button elements
.AsButton(type)
WebExtras provides helper methods for rendering a date time picker attached to a textbox by using a great little date time picker provided by Sébastien Malot. You can get a copy of the date time picker from here.
Markup
@Html.DateTextBoxFor(f => f.DateTextBox)
// Note that this date time picker uses 'i' for minutes
@Html.TimeTextBoxFor(f => f.TimeTextBox, new { format = "hh:ii" })
@Html.DateTimeTextBoxFor(f => f.DateTimeTextBox, new { format = "dd M yyyy hh:ii" })
Output
A slight gotcha with the time only picker is that the date will always be fixed to 31 December 1899.
Unstyled lists can be created by using the AsUnstyled() decorator.
Markup
@Html.List(EList.Unordered, new HtmlListItem[] {
new HtmlListItem("list item 1"),
new HtmlListItem("list item 2"),
new HtmlListItem("list item 3"),
new HtmlListItem("list item 4"),
new HtmlListItem("list item 5")
}).AsUnstyled()
Output
Inline lists can be created by using the AsInline() decorator.
Markup
@Html.List(EList.Unordered, new HtmlListItem[] {
new HtmlListItem("list item 1"),
new HtmlListItem("list item 2"),
new HtmlListItem("list item 3"),
new HtmlListItem("list item 4"),
new HtmlListItem("list item 5")
}).AsInline()
Output