This Build.Mvc Code:
@Html.BuildButton("Log On").Id("login-button") @Html.BuildSubmitButton("Log On").Data("icon", IconName.Key) @{ bool buttonShouldBeDisabled = true; } @( Html.BuildButton("Remove Item"). AddClass("ui-state-error"). When(buttonShouldBeDisabled, x => x.Disabled()))
Creates the following HTML:
<button aria-role="button" id="login-button">Log On</button> <button aria-role="button" data-icon="ui-icon-key" type="submit">Log On</button> <button aria-role="button" class="ui-state-error ui-state-disabled" disabled="disabled">Remove Item</button>