DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

Boolean parameter on .Disabled #47

Closed mhoedeman closed 11 years ago

mhoedeman commented 11 years ago

Add a condition boolean to the .Disabled Extention Method so we can rewrite if (Model.HasConfig) { @Html.Bootstrap().ActionLinkButton("txt", MVC.x.Config())} else { @Html.Bootstrap().ActionLinkButton("txt", MVC.x.Config()).Disabled()}

to: @Html.Bootstrap().ActionLinkButton("txt", MVC.x.Config()).Disabled(!Model.HasConfig)

Example is for button but I assume this is handy everywhere .Disabled() is used as an extention method in BMVC.

See http://www.codeproject.com/Messages/4626151/Conditional-Fluent.aspx

DmitryEfimenko commented 11 years ago

This is done in the newest version. Be careful with updating to a new version. There are couple of breaking changes. For all changes see CodeProject article The website to download license for TB3 (In case you would like to switch) is www.twitterbootstrapmvc.com