Button Building

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>

Last edited Dec 21, 2011 at 5:51 AM by grcodemonkey, version 3

Comments

No comments yet.