DmitryEfimenko / TwitterBootstrapMvc

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

Spacer between Buttons - Enhancement #87

Closed dwelford closed 10 years ago

dwelford commented 10 years ago

Currently I have '''@using (var g = Html.Bootstrap().Begin(new ButtonGroup())) { @g.Button().Style(ButtonStyle.Info).Value("Save").Text("Save").Size(ButtonSize.Large).Tooltip(new Tooltip("Click to Save Record").Placement("bottom")) @g.Button().Text("Cancel").Value("cancel").Size(ButtonSize.Large).Style(ButtonStyle.Danger).HtmlAttributes(new { onclick = string.Format("window.location.href='{0}';", Url.Action("Index")) }) } '''

It would be nice to have @g.Button().Spacer("number of spaces") to apply a gap between the buttons I know the btn-toolbar could be used but I can't find it in the BootStrap.

Just a thought

Thanks

DmitryEfimenko commented 10 years ago

You should not control spacing with html. That's not a good practice. An alternative would be to assign a class or id to the button and control spacing through css. Just like you said, another way is to use btn-toolbar. There is a BMVC helper for that:

@using (Html.Bootstrap().Begin(new ToolBar()))
{

}