TwitterBootstrapMVC

Development for ASP.NET MVC with Bootstrap made simple.

Change Log

3.17.5 11/09/2016

  • Added .Widths() method to all input methods that takes a property of class implementing IBootstrapWidths that allows to set all widths in one go.
  • Setting width to 0 applies class .hidden-xs rather then .col-xs-0
  • Fix for extra validation message displayed for RadioButtonFor() method
  • Added helper methods .AppendHtml() and .PrependHtml() to .Label(), which allows to customize area around label in any way.
  • Added "Font Awesome"-specific extension methods to Icon class. Add namespace TwitterBootstrapMVC.FontAwesome4 in web.config under Views folder to get intellisense for these methods.
  • Minor bug fixes

3.17.0 03/26/2016

  • Added .ShowValidationMessage() method to .EditorFor()
  • Added default bootstrap class 'form-control' to .EditorFor()
  • Fix for .VisibleDependsOn() in case with RadioButtons.
  • Fix for ActionLink with RouteName provided.
  • In case .Link() or .ActionLink() has class 'active' and it has a wrapper (like when it's inside a nav) - apply class 'active' to the wrapper as well.
  • Minor bug fixes

3.16.4 11/14/2015

  • .Div() method now has extensions to specify its offset. Ex: .XsOffset(5)
  • .Div() method now accepts a string as a parameter
  • .DropDownListFromEnum() method now has extensions to specify its width. Ex: .WidthXs() and such.
  • Added methods .Class(), .Data(), and .HtmlAttributes() to class Tabs().
  • Minor bug fixes

3.16.0 6/15/2015

  • [Breaking Change] The html outputs for methods .RadioButtonListFromEnum() and .CheckboxListFromEnum() changed when method .DisplayInlineBlock() is used. (labels are no longer wrapped in a div)
  • Added overload on Accordion... a.BeginPanel() to allow for custom panel styles.
  • Minor bug fixes

3.15.0 4/20/2015

  • Added method .Type() to the .FormGroup() which can customize the html output according to the Bootstrap's specifications for inline/horizontal forms.
  • Added methods .Style() and .Size() to .Link() method.
  • Added a new overload to method.DropDownListFromEnum, which allows you to specify Enum type via syntax .DropDownListFromEnum<MyEnum>.
  • Tab().PrependIcon() now has overload to accept a css class as a string.
  • Added two more extensions to .CheckBoxListFor() and .RadioButtonListFor(): .ContainerHtmlAttributes(), and .ContainerData()
  • Minor bug fixes

3.14.0 12/19/2014

  • Added methods .Class(), .Data(), and .HtmlAttributes() to @tabs.Tab() method.
  • links inside the DropDowns now render attribute role="menuitem" by default.
  • Added JavaScript code to initialize Bootstrap buttons on the page load.
  • Added localization support for members of enums for methods like .DropDownListFromEnum()
  • Added method .AsButtonGroup() to .RadioButtonTrueFalseFor()
  • Minor bug fixes

3.13.1

  • BMVC's Form class now have method .Confirm() that would popup a Bootstrap modal asking whether you'd really like to proceed. The text and title can be customized.
    Please note that this functionality requires this script
  • BMVC's .FileFor() method now has extension method .Accept(), which takes an array of enums FileType. Applying them will filter accepted file types.
  • BMVC's class Carousel now has extension method .Indexed(), which puts a badged number in front of the each pane's title.
  • BMVC's JavaScript update to better handle Visible Depends On functionality.
  • Added an overload to the Bootstrap.Configure(); method that accepts contents of the license file as a string.
  • Minor bug fixes

3.13.0

  • [Breaking Change] Method .CustomControls(...).LabelFor("PropertyName") changes subsequent chain of methods to these that are relevant for the label.
  • [Breaking Change] Method .CustomControls(...).CustomLabel("LabelText") changes subsequent chain of methods to these that are relevant for the label.
  • Added .Readonly() extension method to the .DropDownList() helper.
  • .VisibleDependsOn now has overload which takes an array of criteria values.
  • Added extension method .Size(ModalSize size) to the class Modal.
  • Added extension method .ExcludeMembers() to helper RadioButtonListFromEnum and CheckboxListFromEnum, where you can specify unwanted members of the enum.
  • Minor bug fixes

3.12.0

  • Added disposable method .Begin(new Panel()) to ease writing of Bootstrap panels.
  • Added .HelpText() to DropDownListFromEnum
  • Added extension .Disabled() to RadioButtonsFromEnumFor
  • Minor bug fixes

3.11.0

  • Methods .CheckBoxList(), .RadioButtonList(), .CheckBoxListFromEnum(), and .RadioButtonListFromEnum() now have extension method .AsButtonGroup(), which renders checkboxes/radiobuttons as group of buttons.
  • Class DropDown now has new extension method .ButtonGroup() that makes dropdown to take the whole width of a container.
  • Bootstrap ActionLinks now have method .Confirm() that would popup a Bootstrap modal asking whether you'd really like to proceed. The text and title can be customized.
    Please note that this functionality requires this script
  • Added optional parameter containerHtmlAttributes to the Dropdown builder under Nav builder.
  • Added method .ActiveIf(bool) for class DropDown. Useful when Dropdown is a part of the navigation.
  • Added .ShowValidationMessage() into .Globals() for global configuring.
  • You can now specify id of each tab being created via otional parameter: (@t.Tab("tab 1", "tab1"))
  • Added overload on .CustomControls().LabelFor() to take html fileld name as a string. Fixes issue when using this in the editor template.
  • Added extension method .ExcludeMembers() to helper DropDownListFromEnum, where you can specify unwanted members of the enum.
  • Added extension method .HelpText() to Checkbox and RadioButton helpers
  • Added extension method .Placeholder() to Textarea helper
  • Added extension method .Disabled() to Tabs. For the click action to be disabled make sure you have latest TwitterBootstrapJs.js file
  • Minor bug fixes

3.10.0

  • [Breaking Change] RadioButtonTrueFalseFor renders values as lowercase to conform HTML standards. Ex: "true" instead of "True"
  • Added TwitterBootstrapMvcJs.js file to Nuget package.
  • Added extension method .Id() to the Table class.
  • Added extension methods .OrderByValue() and .OrderByDescription() to .CheckBoxesFromEnumFor() method.
  • Added .Width*() methods to the .LabelFor() of .CustomControls()
  • Properties now can be decorated with attribute [Tooltip] in order for the associated input to get Bootstrap tooltip.
  • Minor bug fixes

3.9.0

  • CheckBoxList/RadioButtonList helpers now have extension method that allows to add a css class to the containing div: .ContainerClass(string)
  • Almost all input helpers now have extension method .VisibleDependsOn(), which takes an expression for the property this input depends on and value which makes input visible/hidden.
  • .FormGroup() has extension method .VisibleDependsOn() as well.
  • .FormGroup() now has method .Text() and .TextFor() to easily output static text/html.
  • Added method @Html.Bootstrap().Div() to address issue 140. It also has method .VisibleDependsOn()
  • [Maybe Breaking Change] Going forward by default .CustomControls() do not render associated label element unless Label was actually specified.
  • Added .Tooltip() extension method to .Label()
  • Minor bug fixes

3.8.0

  • CheckBoxesFromEnum and RadioButtonFromEnum helpers now have overload that takes enum type separately: .RadioButtonFromEnum<EnumType>(...)
  • Class DropDown now also has extension methods .Id(), .Class(), .Data(), and .HtmlAttributes()
  • By default .FormGroup().CheckBox() renders checkbox with label on the right. Now this can be overwritten with any of the following methods:
    • Extension method: .FormGroup().CheckBox(...).Label().PositionedLeft()
    • (View Scope) Globals: Html.Bootstrap().Globals().FormGroup().CheckBoxLabelsPositionLeft();
    • (Application Scope) add key to web.config appSettings: <add key="BMVC.Globals.FormGroup.CheckBoxLabelsPositionLeft" value="true" />
  • Added methods .Link(), .ActionLink(), and .ActionLinkButton() to .FormGroup() chain method.
  • Added support for Eyecon DatePicker via plug-in. Nuget ID: TwitterBootstrapMVC.Eyecon.Datepicker.MVC4
  • Added support for Flaty's Box element via plug-in. Nuget ID: TwitterBootstrapMVC.Flaty.MVC4
  • Almost all input helpers now have extension method .DisabledDependsOn(), which takes an expression for the property this input depends on and value which makes input disabled.
  • .CheckBoxListFor() and .RadioButtonListFor() now has extension method .ScrollOverflow(), which applies css style "overflow:scroll" to the container of the inputs. Useful for large lists.
  • [Breaking Change] Removed obsolete methods on class Form: .WidthXs(), .WidthSm(), .WidthMd(), and .WidthLg()
  • Minor bug fixes

3.7.0

  • .CheckBoxesFromEnumFor() now has an extension method .InputHtmlAttributes<TEnum>(...) allowing to customize input html attributes per each enum member.
  • .CheckBoxesFromEnumFor() now has an extension method .InputData<TEnum>(...) allowing to customize input data html attributes per each enum member.
  • .CheckBoxesFromEnumFor() now has an extension method .LabelHtmlAttributes<TEnum>(...) allowing to customize label html attributes per each enum member.
  • Added helper .DropDownListFromEnumFor(m => m.SomeEnum)
  • Added method .Misc().GetBuilderFor(...), which takes either a new Form() or new Modal() to get the variable for building form or modal elements. Convenient to use in partial views during ajax requests.
  • [Breaking Change] Removed method .Misc().GetFormHelperFromViewData() in favor of .Misc().GetFormBuilderFromViewData()
  • [Breaking Change] Removed method .Misc().SaveFormHelperToViewData() in favor of new extension method new Form().SaveToViewData()
  • Minor bug fixes

3.6.0

  • Added method .BeginDropDown() to the nav builder.
  • Added method .SubNav() to the nav builder.
  • Added AjaxLinks to nav builder.
  • .CheckBoxesFromEnumFor() method can now operate with enum arrays and IEnumerable<> to submit multiple checked values.
  • Added extension methods .InputClass(), .InputData(), .InputHtmlAttributes(), and .LabelHtmlAttributes() to .CheckBoxesFromEnumFor()
  • Added extension method .Vertical() to class ButtonGroup to render vertical button group.
  • .CustomControls() now has extension method .ValidationMessageFor()
  • Added method .Size() to class DropDown
  • Added a bunch of global settings. Check out extension methods under Html.Bootstrap().Globals()
  • Minor bug fixes

3.5.0

  • Extended disposable methods relevant to building Table. Now you can add table header, body and cell items.
  • Added .Disabled() extension method to most of the input helpers.
  • Added .DisplayFor() and .EditorFor() helpers to .FormGroup()
  • Minor bug fixes

3.3.2

  • Added overload to .CheckBoxListFor() and .RadioButtonListFor() that takes an IEnumerable as a source instead of an expression.
  • Added extension method .FormGroup().ControlsHtmlAttrs([anonymous object]) that allows to add html attributes to the div that contains all controls in the form group.
  • When creating Tabs, the main container div will now have an id attribute of the string that you pass to new Tabs("here")
  • Drop downs now have extension method to generate ajax-y menu items: @dropDown.AjaxActionLink(...)
  • Added overload to .HelpText() that takes IHtmlString
  • Added Global setting to set placeholders for all textbox/password fields: Html.Bootstrap().Globals().AlwaysIncludePlaceholder();
  • Minor bug fixes

3.2.2

  • [TB3 Only] Removed overload that takes HelpTextStyle from the method .ShowValidationMessage() since Bootstrap 3 only has one style of help text now.
  • [TB3 Only] Deprecated methods .WidthLg(), .WidthMd(), .WidthSm(), .WidthXs() on class Form in favor of newly added methods .LabelWidth[size]().
  • [TB3 Only] Added methods .InputWidth[size]() to class Form.
  • [TB3 Only] Added methods .Width[size]() to pretty much all helper methods like .TextBoxFor() to manipulate width of the input container.
  • [TB3 Only] Added global method Html.Bootstrap().Globals().SetValidationMessageInline();. When used, puts validation message after inputs container and calculates its width based on the width of the label and inputs container.
  • Added method .AutoFocus() to inputs and buttons.
  • Minor bug fixes

3.1.0

  • [TB3 Only] Validation Messages inside the form groups are not wrapped in the <div class="help-block"> anymore.
  • Added global setting to put validation messages before the input: Html.Bootstrap().Globals().SetValidationMessageBeforeInput();
  • Added misc helpers to ease setting and getting variable form to the ViewData (Helpful when using partial views inside the form). Setter: Html.Bootstrap().Misc().SaveFormHelperToViewData(form, "myForm");. Getter: var form = Html.Bootstrap().Misc().GetFormHelperFromViewData("myForm");
  • Added global setting to set input sizes: Html.Bootstrap().Globals().InputSize(InputSize.Large);
  • [Breaking Change] Dropped optional parameter from extension method .DisplayInlineBlock() on helpers .CheckBoxList and similar. Implementation of it included applying inline css styles, which is not a good practice.
  • Minor bug fixes

3.0.3

Be careful when updating from previous version. There will be couple of breaking changes.

  • [Breaking Change] You have to specify which version of Bootstrap you are using by adding a namespace into web.config file under Views folder. Options: TwitterBootstrap2or TwitterBootstrap3
  • [Breaking Change] All methods .IconPrepend() are renamed into .PrependIcon() for consistency
  • [Breaking Change] All methods .IconAppend() are renamed into .AppendIcon() for consistency
  • [Breaking Change] When using .Begin(new Modal()) it renders modal automatically with fade class on it. Therefore extension method .Fade() is replaced with method .FadeOff()
  • [Breaking Change] When building Nav using method .Begin(new Nav), methods .Divider() and .Header() now require @ sign. Ex: @nav.Divider(). This is done for consistency purposes.
  • [Breaking Change] Similar to the change above, when building Tabs, method .Tab() now requires @ sign. Ex: @tabs.Tab("Some Tab Name")
  • [!] New syntax is available when using .Begin(new Form()) - especially useful for Bootstrap 3
  • [TB3 Only] For Bootstrap 3 method .ControlGroup is renamed into .FormGroup to match css classes of Twitter Bootstrap 3
  • [TB3 Only] .PrependIcon() and .AppendIcon() now do not support Icons enum. You have to specify css class as a string (If people want this supported, I might add it).
  • Modal now has new extension methods: .BackdropOff(), .KeyboardOff(), .ShowOff(), and .Remote(), which allows to load remote content into modal body.
  • Because most of the time modal header only contains an <h> tag (and possibly the close button), instead of using disposable method .BeginHeader(), you can write @modal.Header("Modal Header")
  • BMVC buttons and links now support .Tooltip(...)
  • Tooltip now has extension methods .Delay() and .Container()
  • Method .Disabled() on BMVC buttons and links optionally accepts bool isDisabled
  • Dropped support for deprecated method .Tooltip(TooltipConfiguration configuration) in favor of .Tooltip(Tooltip tooltip)
  • Dropped support for deprecated method .Bootstrap().Container() in favor of .Begin()
  • Added a way to set things globally. For example, you can set default color of the buttons or whether to show or hide required stars next to the inputs using Html.Bootstrap().Globals()...
  • BMVC buttons now have method .TriggerModal() where you can specify id of the modal to show on button click.
  • Most helpers now have extension method .Class() that allows setting css class quickly
  • Most helpers now have extension method .Data() that allows to set data-* html attributes
  • Minor bug fixes

I allowed quite many breaking changes in this release. Why? Because Bootstrap 3 is pretty much a different product and I used it as an excuse to clean up project :) Going forward I'll try to avoid breaking changes.