├── .gitignore
├── BootstrapMvc.sln
├── LICENSE.txt
├── README.md
├── readme-sample.png
├── samples
├── Bootstrap3Mvc5.Sample
│ ├── App_Start
│ │ ├── FilterConfig.cs
│ │ └── RouteConfig.cs
│ ├── Bootstrap3Mvc5.Sample.csproj
│ ├── Content
│ │ ├── Site.css
│ │ ├── Site.min.css
│ │ ├── bootstrap-theme.css
│ │ ├── bootstrap-theme.css.map
│ │ ├── bootstrap-theme.min.css
│ │ ├── bootstrap-theme.min.css.map
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ ├── bootstrap.min.css
│ │ └── bootstrap.min.css.map
│ ├── Controllers
│ │ └── HomeController.cs
│ ├── Global.asax
│ ├── Global.asax.cs
│ ├── Models
│ │ └── DemoModelOne.cs
│ ├── Scripts
│ │ ├── _references.js
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ ├── jquery-2.2.4.intellisense.js
│ │ ├── jquery-2.2.4.js
│ │ ├── jquery-2.2.4.min.js
│ │ └── jquery-2.2.4.min.map
│ ├── Views
│ │ ├── Home
│ │ │ ├── Basics.cshtml
│ │ │ ├── Components.cshtml
│ │ │ ├── Extend.cshtml
│ │ │ ├── Forms.cshtml
│ │ │ ├── Index.cshtml
│ │ │ ├── Installation.cshtml
│ │ │ └── Partial
│ │ │ │ ├── Alerts.cshtml
│ │ │ │ ├── Badges.cshtml
│ │ │ │ ├── Buttons.cshtml
│ │ │ │ ├── Icons.cshtml
│ │ │ │ ├── Labels.cshtml
│ │ │ │ ├── ListGroups.cshtml
│ │ │ │ ├── Paging.cshtml
│ │ │ │ ├── Panels.cshtml
│ │ │ │ └── PartialForm.cshtml
│ │ ├── Shared
│ │ │ ├── Error.cshtml
│ │ │ └── _Layout.cshtml
│ │ ├── Web.config
│ │ └── _ViewStart.cshtml
│ ├── Web.Debug.config
│ ├── Web.Release.config
│ ├── Web.config
│ ├── favicon.ico
│ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
│ └── packages.config
├── Bootstrap3Mvc6.Sample
│ ├── Bootstrap3Mvc6.Sample.csproj
│ ├── Controllers
│ │ └── HomeController.cs
│ ├── Models
│ │ └── DemoModelOne.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── Startup.cs
│ ├── Views
│ │ ├── Home
│ │ │ ├── Basics.cshtml
│ │ │ ├── Components.cshtml
│ │ │ ├── Extend.cshtml
│ │ │ ├── Forms.cshtml
│ │ │ ├── Index.cshtml
│ │ │ ├── Installation.cshtml
│ │ │ └── Partial
│ │ │ │ ├── Alerts.cshtml
│ │ │ │ ├── Badges.cshtml
│ │ │ │ ├── Buttons.cshtml
│ │ │ │ ├── Icons.cshtml
│ │ │ │ ├── Labels.cshtml
│ │ │ │ ├── ListGroups.cshtml
│ │ │ │ ├── Paging.cshtml
│ │ │ │ ├── Panels.cshtml
│ │ │ │ └── PartialForm.cshtml
│ │ ├── Shared
│ │ │ └── _Layout.cshtml
│ │ ├── _ViewImports.cshtml
│ │ └── _ViewStart.cshtml
│ ├── runtimeconfig.template.json
│ └── web.config
└── Bootstrap4Mvc6.Sample
│ ├── Bootstrap4Mvc6.Sample.csproj
│ ├── Controllers
│ └── HomeController.cs
│ ├── Models
│ └── DemoModelOne.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── Startup.cs
│ ├── Views
│ ├── Home
│ │ ├── Basics.cshtml
│ │ ├── Components
│ │ │ ├── Alerts.cshtml
│ │ │ ├── Badges.cshtml
│ │ │ ├── Buttons.cshtml
│ │ │ ├── ListGroups.cshtml
│ │ │ ├── Paging.cshtml
│ │ │ └── Panels.cshtml
│ │ ├── Extend.cshtml
│ │ ├── FormPartial.cshtml
│ │ ├── Forms.cshtml
│ │ ├── Index.cshtml
│ │ └── Installation.cshtml
│ ├── Shared
│ │ └── _Layout.cshtml
│ ├── _ViewImports.cshtml
│ └── _ViewStart.cshtml
│ ├── runtimeconfig.template.json
│ └── web.config
├── src
├── BootstrapMvc.Bootstrap3
│ ├── AnyContentElements
│ │ ├── Badge.cs
│ │ ├── BadgeExtensions.cs
│ │ ├── Label.cs
│ │ └── LabelExtensions.cs
│ ├── BaseColor.cs
│ ├── BootstrapMvc.Bootstrap3.csproj
│ ├── Buttons
│ │ ├── ButtonExtensions.cs
│ │ └── ButtonGroupContent.cs
│ ├── Dropdown
│ │ ├── DropdownMenu.cs
│ │ ├── DropdownMenuContent.cs
│ │ ├── DropdownMenuExtensions.cs
│ │ ├── DropdownMenuItemDivider.cs
│ │ ├── DropdownMenuItemHeader.cs
│ │ ├── DropdownMenuItemLink.cs
│ │ ├── DropdownMenuParentExtensions.cs
│ │ └── IDropdownMenuItem.cs
│ ├── ElementExtensions.cs
│ ├── Elements
│ │ ├── Icon.cs
│ │ └── IconExtensions.cs
│ ├── EnumToStringConverter.cs
│ ├── Grid
│ │ ├── GridColExtensions.cs
│ │ ├── GridRowContent.cs
│ │ └── IGridSizableExtensions.cs
│ ├── IconType.cs
│ ├── LabelType.cs
│ ├── Lists
│ │ ├── DefinitionList.cs
│ │ ├── DefinitionListContent.cs
│ │ └── DefinitionListExtensions.cs
│ ├── MessageType.cs
│ ├── PaginatorSize.cs
│ ├── Paging
│ │ ├── Paginator.cs
│ │ ├── PaginatorContent.cs
│ │ ├── PaginatorExtensions.cs
│ │ ├── PaginatorGenerator.cs
│ │ ├── PaginatorGeneratorExtensions.cs
│ │ └── PaginatorItem.cs
│ ├── Panels
│ │ ├── EnumToStringConverter.cs
│ │ ├── Panel.cs
│ │ ├── PanelBody.cs
│ │ ├── PanelContent.cs
│ │ ├── PanelExtensions.cs
│ │ ├── PanelFooter.cs
│ │ ├── PanelHeader.cs
│ │ └── PanelType.cs
│ ├── TextColor.cs
│ └── Visibility.cs
├── BootstrapMvc.Bootstrap3Mvc5
│ ├── Bootstrap3Mvc5AnyContentExtensions.cs
│ └── BootstrapMvc.Bootstrap3Mvc5.csproj
├── BootstrapMvc.Bootstrap3Mvc6
│ ├── Bootstrap3Mvc6AnyContentExtensions.cs
│ └── BootstrapMvc.Bootstrap3Mvc6.csproj
├── BootstrapMvc.Bootstrap4
│ ├── Badge
│ │ ├── Badge.cs
│ │ ├── BadgeExtensions.cs
│ │ ├── BadgeType.cs
│ │ └── EnumToStringConverter.cs
│ ├── BootstrapMvc.Bootstrap4.csproj
│ ├── Grid
│ │ ├── GridColExtensions.cs
│ │ ├── GridRowContent.cs
│ │ └── IGridSizableExtensions.cs
│ ├── Label_Replacement
│ │ └── LabelExtensions.cs
│ └── Table
│ │ ├── EnumToStringConverter.cs
│ │ ├── TableContent.cs
│ │ ├── TableHeader.cs
│ │ ├── TableHeaderExtensions.cs
│ │ └── TableHeaderStyle.cs
├── BootstrapMvc.Bootstrap4Mvc6
│ ├── Bootstrap4Mvc6AnyContentExtensions.cs
│ └── BootstrapMvc.Bootstrap4Mvc6.csproj
├── BootstrapMvc.BootstrapCommon
│ ├── Anchor.cs
│ ├── AnchorExtensions.cs
│ ├── BootstrapMvc.BootstrapCommon.csproj
│ ├── Components
│ │ ├── Alert
│ │ │ ├── Alert.cs
│ │ │ ├── AlertExtensions.cs
│ │ │ ├── AlertType.cs
│ │ │ └── EnumToStringConverter.cs
│ │ ├── ButtonGroup
│ │ │ ├── ButtonGroup.cs
│ │ │ ├── ButtonGroupContent.cs
│ │ │ ├── ButtonGroupExtensions.cs
│ │ │ ├── ButtonToolbar.cs
│ │ │ ├── ButtonToolbarContent.cs
│ │ │ └── ButtonToolbarExtensions.cs
│ │ ├── Buttons
│ │ │ ├── Button.cs
│ │ │ ├── ButtonExtensions.cs
│ │ │ ├── ButtonSize.cs
│ │ │ ├── ButtonType.cs
│ │ │ ├── EnumToStringConverter.cs
│ │ │ ├── IButtonSizable.cs
│ │ │ └── IButtonSizableExtensions.cs
│ │ ├── Form_Controls
│ │ │ ├── Checkbox.cs
│ │ │ ├── CheckboxExtensions.cs
│ │ │ ├── EnumToStringConverter.cs
│ │ │ ├── IFormControl.cs
│ │ │ ├── IInlineDisplay.cs
│ │ │ ├── IInlineDisplayExtensions.cs
│ │ │ ├── ISelectItem.cs
│ │ │ ├── ITextDisplay.cs
│ │ │ ├── ITextDisplayExtensions.cs
│ │ │ ├── IValueHolder.cs
│ │ │ ├── IValueHolderExtensions.cs
│ │ │ ├── Input.cs
│ │ │ ├── InputExtensions.cs
│ │ │ ├── InputType.cs
│ │ │ ├── Radio.cs
│ │ │ ├── RadioExtensions.cs
│ │ │ ├── Select.cs
│ │ │ ├── SelectContent.cs
│ │ │ ├── SelectExtensions.cs
│ │ │ ├── SelectOptGroup.cs
│ │ │ ├── SelectOptGroupContent.cs
│ │ │ ├── SelectOptGroupExtensions.cs
│ │ │ ├── SelectOption.cs
│ │ │ ├── SelectOptionExtensions.cs
│ │ │ ├── StaticValue.cs
│ │ │ ├── StaticValueExtensions.cs
│ │ │ ├── Textarea.cs
│ │ │ └── TextareaExtensions.cs
│ │ ├── Forms
│ │ │ ├── ControlContext.cs
│ │ │ ├── ControlContextExtensions.cs
│ │ │ ├── EnumToStringConverter.cs
│ │ │ ├── Fieldset.cs
│ │ │ ├── FieldsetExtensions.cs
│ │ │ ├── Form.cs
│ │ │ ├── FormContentBase.cs
│ │ │ ├── FormContentOfT.cs
│ │ │ ├── FormEnctype.cs
│ │ │ ├── FormExtensions.cs
│ │ │ ├── FormGroup.cs
│ │ │ ├── FormGroupExtensions.cs
│ │ │ ├── FormGroupLabel.cs
│ │ │ ├── FormOfT.cs
│ │ │ ├── FormType.cs
│ │ │ ├── HelpBlock.cs
│ │ │ ├── HelpBlockExtensions.cs
│ │ │ ├── IFormContext.cs
│ │ │ ├── Legend.cs
│ │ │ ├── LegendExtensions.cs
│ │ │ ├── SubmitMethod.cs
│ │ │ ├── ValidationSummary.cs
│ │ │ ├── ValidationSummaryExtensions.cs
│ │ │ └── ValidationSummaryOfT.cs
│ │ └── ListGroups
│ │ │ ├── ActionableListGroup.cs
│ │ │ ├── ActionableListGroupContent.cs
│ │ │ ├── EnumToStringConverter.cs
│ │ │ ├── IListGroupElement.cs
│ │ │ ├── IListGroupElementExtensions.cs
│ │ │ ├── ListGroupButtonItem.cs
│ │ │ ├── ListGroupExtensions.cs
│ │ │ ├── ListGroupItemType.cs
│ │ │ ├── ListGroupLinkItem.cs
│ │ │ ├── ListGroupSimpleItem.cs
│ │ │ ├── OrdinaryListGroup.cs
│ │ │ └── OrdinaryListGroupContent.cs
│ ├── DateInputMode.cs
│ ├── IActivable.cs
│ ├── IActivableExtensions.cs
│ ├── IDisableable.cs
│ ├── IDisableableExtensions.cs
│ ├── IDropdownMenuParentMarker.cs
│ ├── IPlaceholderTarget.cs
│ ├── Layout
│ │ ├── Grid
│ │ │ ├── GridCol.cs
│ │ │ ├── GridColExtensions.cs
│ │ │ ├── GridRow.cs
│ │ │ ├── GridRowContent.cs
│ │ │ ├── GridRowExtensions.cs
│ │ │ ├── GridSize.cs
│ │ │ ├── IGridSizable.cs
│ │ │ └── IGridSizableExtensions.cs
│ │ └── Table
│ │ │ ├── EnumToStringConverter.cs
│ │ │ ├── Table.cs
│ │ │ ├── TableBody.cs
│ │ │ ├── TableCaption.cs
│ │ │ ├── TableCell.cs
│ │ │ ├── TableCellExtensions.cs
│ │ │ ├── TableContent.cs
│ │ │ ├── TableExtensions.cs
│ │ │ ├── TableFooter.cs
│ │ │ ├── TableHeader.cs
│ │ │ ├── TableHeaderCell.cs
│ │ │ ├── TableRow.cs
│ │ │ ├── TableRowCellColor.cs
│ │ │ ├── TableRowContent.cs
│ │ │ ├── TableRowExtensions.cs
│ │ │ ├── TableSection.cs
│ │ │ ├── TableSectionContent.cs
│ │ │ ├── TableSectionExtensions.cs
│ │ │ └── TableStyles.cs
│ ├── MarkersExtensions.cs
│ ├── OrdinaryElementExtensions.cs
│ └── Typography
│ │ └── List
│ │ ├── List.cs
│ │ ├── ListContent.cs
│ │ ├── ListExtensions.cs
│ │ └── ListType.cs
├── BootstrapMvc.Core
│ ├── AnyContentElementExtensions.cs
│ ├── BootstrapMvc.Core.csproj
│ ├── Core
│ │ ├── AnyContent.cs
│ │ ├── AnyContentElement.cs
│ │ ├── ContentElementOfT.cs
│ │ ├── DisposableContent.cs
│ │ ├── Element.cs
│ │ ├── IAnyContentMarker.cs
│ │ ├── IAnyContentMarkerOfT.cs
│ │ ├── IBootstrapContext.cs
│ │ ├── IBootstrapContextOfT.cs
│ │ ├── IControlContext.cs
│ │ ├── IItemWriter.cs
│ │ ├── IItemWriterOfT.cs
│ │ ├── IItemWriterOfTAndTContent.cs
│ │ ├── ILink.cs
│ │ ├── IModelValidationError.cs
│ │ ├── IModelValidationResult.cs
│ │ ├── ITagBuilder.cs
│ │ ├── IWritable.cs
│ │ ├── IWritableItem.cs
│ │ ├── IWritingHelper.cs
│ │ ├── IWritingHelperOfT.cs
│ │ ├── OrdinaryElement.cs
│ │ ├── SimpleBlock.cs
│ │ ├── WritableItem.cs
│ │ └── _Classes.cd
│ ├── ElementExtensions.cs
│ ├── IAnyContentMarkerExtensions.cs
│ ├── IControlContextExtensions.cs
│ ├── LinkExtensions.cs
│ └── WritableItemExtensions.cs
├── BootstrapMvc.Mvc5
│ ├── BootstrapHelper.cs
│ ├── BootstrapHelperOfT.cs
│ ├── BootstrapMvc.Mvc5.csproj
│ ├── BootstrapViewPage.cs
│ ├── BootstrapViewPageT.cs
│ ├── ItemWriterOfT.cs
│ ├── ItemWriterOfTAndTContent.cs
│ ├── ModelValidationError.cs
│ ├── ModelValidationResult.cs
│ ├── Mvc5LinkExtensions.cs
│ └── TagBuilder.cs
└── BootstrapMvc.Mvc6
│ ├── BootstrapHelper.cs
│ ├── BootstrapHelperOfT.cs
│ ├── BootstrapMvc.Mvc6.csproj
│ ├── ItemWriterOfT.cs
│ ├── ItemWriterOfTAndTContent.cs
│ ├── ModelValidationError.cs
│ ├── ModelValidationResult.cs
│ ├── Mvc6LinkExtensions.cs
│ └── TagBuilder.cs
└── test
├── BootstrapMvc.Bootstrap3.Tests
├── BootstrapMvc.Bootstrap3.Tests.xproj
├── FormsTest.cs
├── IconTest.cs
├── PanelsTest.cs
├── TablesTest.cs
├── TestBase.cs
├── project.json
└── project.lock.json
├── BootstrapMvc.Core.Tests
├── BootstrapMvc.Core.Tests.xproj
├── ContentElementTests.cs
├── ContentTests.cs
├── DisposableContentTests.cs
├── DummyWritableBlock.cs
├── WritableBlockTests.cs
├── project.json
└── project.lock.json
└── BootstrapMvc.Mvc5.Tests
├── BootstrapContextTests.cs
├── BootstrapMvc.Mvc5.Tests.xproj
├── LinkExtensionsTest.cs
├── TagBuilderTests.cs
├── project.json
└── project.lock.json
/.gitignore:
--------------------------------------------------------------------------------
1 | *.nupkg
2 | *.suo
3 | *.user
4 | /TestResults
5 | /packages
6 | StyleCop.Cache
7 | bin
8 | obj
9 | /.vs
10 | /artifacts
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2015 Dmitry Popov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/readme-sample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justdmitry/BootstrapMvc/dc38cfd87bcc45bc5ec6f5b8eaa31a12f89aa0ac/readme-sample.png
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/App_Start/FilterConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web;
2 | using System.Web.Mvc;
3 |
4 | namespace Bootstrap3Mvc5.Sample
5 | {
6 | public class FilterConfig
7 | {
8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9 | {
10 | filters.Add(new HandleErrorAttribute());
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/App_Start/RouteConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Routing;
7 |
8 | namespace Bootstrap3Mvc5.Sample
9 | {
10 | public class RouteConfig
11 | {
12 | public static void RegisterRoutes(RouteCollection routes)
13 | {
14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15 |
16 | routes.MapRoute(
17 | name: "Default",
18 | url: "{action}/{id}",
19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Content/Site.css:
--------------------------------------------------------------------------------
1 | /* Set padding to keep content from hitting the edges */
2 | .body-content {
3 | padding-left: 15px;
4 | padding-right: 15px;
5 | }
6 |
7 | /* Override the default bootstrap behavior where horizontal description lists
8 | will truncate terms that are too long to fit in the left column
9 | */
10 | .dl-horizontal dt {
11 | white-space: normal;
12 | }
13 |
14 | /* Set width on the form input elements since they're 100% wide by default */
15 | input,
16 | select,
17 | textarea {
18 | max-width: 280px;
19 | }
20 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Content/Site.min.css:
--------------------------------------------------------------------------------
1 | .body-content{padding-left:15px;padding-right:15px}.dl-horizontal dt{white-space:normal}input,select,textarea{max-width:280px}
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Bootstrap3Mvc5.Sample.MvcApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.Mvc;
6 | using System.Web.Routing;
7 |
8 | namespace Bootstrap3Mvc5.Sample
9 | {
10 | public class MvcApplication : System.Web.HttpApplication
11 | {
12 | protected void Application_Start()
13 | {
14 | AreaRegistration.RegisterAllAreas();
15 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
16 | RouteConfig.RegisterRoutes(RouteTable.Routes);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Models/DemoModelOne.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Bootstrap3Mvc5.Sample.Models
4 | {
5 | public class DemoModelOne
6 | {
7 | public string StringField { get; set; }
8 |
9 | public bool BooleanField { get; set; }
10 |
11 | public int IntegerField { get; set; }
12 |
13 | public DateTimeOffset DateTimeOffsetField { get; set; }
14 |
15 | public string FieldWithError { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justdmitry/BootstrapMvc/dc38cfd87bcc45bc5ec6f5b8eaa31a12f89aa0ac/samples/Bootstrap3Mvc5.Sample/Scripts/_references.js
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/Home/Basics.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Basics of BootstrapMvc";
3 | }
4 |
5 |
@ViewBag.Title
6 |
7 | This page is under construction
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/Home/Components.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Components";
3 |
4 | Html.RenderPartial("Partial/Alerts");
5 | Html.RenderPartial("Partial/Badges");
6 | Html.RenderPartial("Partial/Icons");
7 | Html.RenderPartial("Partial/Labels");
8 | Html.RenderPartial("Partial/Buttons");
9 | Html.RenderPartial("Partial/ListGroups");
10 | Html.RenderPartial("Partial/Panels");
11 | Html.RenderPartial("Partial/Paging");
12 | }
13 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/Home/Extend.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Extending BootstrapMvc";
3 | }
4 |
5 | @ViewBag.Title
6 |
7 | This page is under construction
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/Home/Installation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "BootstrapMvc: Installation";
3 | }
4 |
5 | @ViewBag.Title
6 |
7 | 1. Install NuGet package
8 |
9 |
10 | Install BootstrapMvc.Bootstrap3Mvc5
11 | package from NuGet to your ASP.MVC5 project:
Install-Package BootstrapMvc.Bootstrap3Mvc5
12 |
13 |
14 |
15 | 2. Update Views\Web.config
file
16 |
17 |
18 | Modify your Views\Web.config
file (and all Areas\<Area>\Views\Web.config
too),
19 | replace base class for views (in <system.web.webPages.razor>
section):
20 | instead:
<pages pageBaseType="System.Web.Mvc.WebViewPage">
21 | write:
<pages pageBaseType="BootstrapMvc.Mvc5.BootstrapViewPage">
22 |
23 | And add one more namespace to namespaces list: <add namespace="BootstrapMvc" />
24 |
25 | 3. Clean and Rebuild your project
26 |
27 | Clean and Rebuild you project to activate changes and activate intellisence. Rarely, a Visual Studio restart helps.
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/Home/Partial/Badges.cshtml:
--------------------------------------------------------------------------------
1 | Badges
2 |
3 | @using (Bootstrap.BeginGridRow())
4 | {
5 | using (Bootstrap.BeginGridCol(0, 7, 7, 7))
6 | {
7 |
8 | @@Bootstrap.Badge("42")
9 | @@Bootstrap.Badge(MvcHtmlString.Create("To be or <s>not</s> to be?"))
10 | @@Bootstrap.Badge("Hello World!").Content(Bootstrap.Icon(IconType.Gift))
11 |
12 | }
13 | using (Bootstrap.BeginGridCol(0, 5, 5, 5))
14 | {
15 | @Bootstrap.Badge("42")
16 | @Bootstrap.Badge(MvcHtmlString.Create("To be or not to be?"))
17 | @Bootstrap.Badge("Hello World!").Content(Bootstrap.Icon(IconType.Gift))
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/Home/Partial/Icons.cshtml:
--------------------------------------------------------------------------------
1 | Icons
2 |
3 | All icons are identified via enum, you do not need to write classes as strings.
4 | @using (Bootstrap.BeginGridRow())
5 | {
6 | using (Bootstrap.BeginGridCol(0, 7, 7, 7))
7 | {
8 |
9 | @@Bootstrap.Icon(IconType.Arrow_Down)
10 | @@Bootstrap.Icon(IconType.Arrow_Left)
11 | @@Bootstrap.Icon(IconType.Arrow_Up)
12 | @@Bootstrap.Icon(IconType.Arrow_Right)
13 |
14 | }
15 | using (Bootstrap.BeginGridCol(0, 5, 5, 5))
16 | {
17 | @Bootstrap.Icon(IconType.Arrow_Down)
18 | @Bootstrap.Icon(IconType.Arrow_Left)
19 | @Bootstrap.Icon(IconType.Arrow_Up)
20 | @Bootstrap.Icon(IconType.Arrow_Right)
21 | }
22 | }
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/Home/Partial/PartialForm.cshtml:
--------------------------------------------------------------------------------
1 | @model Bootstrap3Mvc5.Sample.Models.DemoModelOne
2 | @{
3 | using (Bootstrap.BeginFormFieldset("Fieldset in partial subview"))
4 | {
5 | using (Bootstrap.FormGroupFor(m => m.StringField).Label("Field with complex content").WithSizedControls().BeginContent())
6 | {
7 | @Bootstrap.Input().Size(6, 6, 6, 6)
8 | @Bootstrap.HelpBlock("Some text about this control")
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = null;
3 | }
4 |
5 |
6 |
7 |
8 |
9 | Error
10 |
11 |
12 |
13 | Error.
14 | An error occurred while processing your request.
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
4 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justdmitry/BootstrapMvc/dc38cfd87bcc45bc5ec6f5b8eaa31a12f89aa0ac/samples/Bootstrap3Mvc5.Sample/favicon.ico
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justdmitry/BootstrapMvc/dc38cfd87bcc45bc5ec6f5b8eaa31a12f89aa0ac/samples/Bootstrap3Mvc5.Sample/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justdmitry/BootstrapMvc/dc38cfd87bcc45bc5ec6f5b8eaa31a12f89aa0ac/samples/Bootstrap3Mvc5.Sample/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justdmitry/BootstrapMvc/dc38cfd87bcc45bc5ec6f5b8eaa31a12f89aa0ac/samples/Bootstrap3Mvc5.Sample/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justdmitry/BootstrapMvc/dc38cfd87bcc45bc5ec6f5b8eaa31a12f89aa0ac/samples/Bootstrap3Mvc5.Sample/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc5.Sample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Bootstrap3Mvc6.Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp1.0
5 | true
6 | Bootstrap3Mvc6.Sample
7 | Exe
8 | Bootstrap3Mvc6.Sample
9 | 1.0.4
10 |
11 |
12 |
13 |
14 | PreserveNewest
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Models/DemoModelOne.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Bootstrap3Mvc6.Sample.Models
4 | {
5 | public class DemoModelOne
6 | {
7 | public string StringField { get; set; }
8 |
9 | public bool BooleanField { get; set; }
10 |
11 | public int IntegerField { get; set; }
12 |
13 | public DateTimeOffset DateTimeOffsetField { get; set; } = DateTimeOffset.Now;
14 |
15 | public string FieldWithError { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:33453/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNET_ENV": "Development"
16 | }
17 | },
18 | "web": {
19 | "commandName": "web",
20 | "launchBrowser": true,
21 | "launchUrl": "http://localhost:5000",
22 | "environmentVariables": {
23 | "Hosting:Environment": "Development"
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Views/Home/Basics.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Basics of BootstrapMvc";
3 | }
4 |
5 | @ViewBag.Title
6 |
7 | This page is under construction
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Views/Home/Components.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Components";
3 |
4 | await Html.RenderPartialAsync("Partial/Alerts");
5 | await Html.RenderPartialAsync("Partial/Badges");
6 | await Html.RenderPartialAsync("Partial/Icons");
7 | await Html.RenderPartialAsync("Partial/Labels");
8 | await Html.RenderPartialAsync("Partial/Buttons");
9 | await Html.RenderPartialAsync("Partial/ListGroups");
10 | await Html.RenderPartialAsync("Partial/Panels");
11 | await Html.RenderPartialAsync("Partial/Paging");
12 | }
13 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Views/Home/Extend.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Extending BootstrapMvc";
3 | }
4 |
5 | @ViewBag.Title
6 |
7 | This page is under construction
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Views/Home/Installation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "BootstrapMvc: Installation";
3 | }
4 |
5 | @ViewBag.Title
6 |
7 | 1. Add dependency to project.json
8 |
9 |
10 | "dependencies": {
11 | ....
12 | "BootstrapMvc.Bootstrap3Mvc6": "2.1.0"
13 | }
14 |
15 |
16 | 2. Update Views\_ViewImports.cshtml
file
17 |
18 |
19 | Add two lines to Views\_ViewImports.cshtml
file:
20 |
@@using BootstrapMvc
21 | @@inject BootstrapMvc.Mvc6.BootstrapHelper<TModel> Bootstrap
22 |
23 |
24 | 3. Register in DI container
25 |
26 |
27 | Append to ConfigureServices()
method in Startup.cs
:
28 |
services.AddTransient(typeof(BootstrapMvc.Mvc6.BootstrapHelper<>));
29 |
30 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Views/Home/Partial/Badges.cshtml:
--------------------------------------------------------------------------------
1 | Badges
2 |
3 | @using (Bootstrap.BeginGridRow())
4 | {
5 | using (Bootstrap.BeginGridCol(0, 7, 7, 7))
6 | {
7 |
8 | @@Bootstrap.Badge("42")
9 | @@Bootstrap.Badge(new HtmlString("To be or <s>not</s> to be?"))
10 | @@Bootstrap.Badge("Hello World!").Content(Bootstrap.Icon(IconType.Gift))
11 |
12 | }
13 | using (Bootstrap.BeginGridCol(0, 5, 5, 5))
14 | {
15 | @Bootstrap.Badge("42")
16 | @Bootstrap.Badge(new HtmlString("To be or not to be?"))
17 | @Bootstrap.Badge("Hello World!").Content(Bootstrap.Icon(IconType.Gift))
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Views/Home/Partial/Icons.cshtml:
--------------------------------------------------------------------------------
1 | Icons
2 |
3 | All icons are identified via enum, you do not need to write classes as strings.
4 | @using (Bootstrap.BeginGridRow())
5 | {
6 | using (Bootstrap.BeginGridCol(0, 7, 7, 7))
7 | {
8 |
9 | @@Bootstrap.Icon(IconType.Arrow_Down)
10 | @@Bootstrap.Icon(IconType.Arrow_Left)
11 | @@Bootstrap.Icon(IconType.Arrow_Up)
12 | @@Bootstrap.Icon(IconType.Arrow_Right)
13 |
14 | }
15 | using (Bootstrap.BeginGridCol(0, 5, 5, 5))
16 | {
17 | @Bootstrap.Icon(IconType.Arrow_Down)
18 | @Bootstrap.Icon(IconType.Arrow_Left)
19 | @Bootstrap.Icon(IconType.Arrow_Up)
20 | @Bootstrap.Icon(IconType.Arrow_Right)
21 | }
22 | }
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Views/Home/Partial/PartialForm.cshtml:
--------------------------------------------------------------------------------
1 | @model Bootstrap3Mvc6.Sample.Models.DemoModelOne
2 | @{
3 | using (Bootstrap.BeginFormFieldset("Fieldset in partial subview"))
4 | {
5 | using (Bootstrap.FormGroupFor(m => m.StringField).Label("Field with complex content").WithSizedControls().BeginContent())
6 | {
7 | @Bootstrap.Input().Size(6, 6, 6, 6)
8 | @Bootstrap.HelpBlock("Some text about this control")
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using BootstrapMvc
2 | @using Microsoft.AspNetCore.Html;
3 | @inject BootstrapMvc.Mvc6.BootstrapHelper Bootstrap
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/runtimeconfig.template.json:
--------------------------------------------------------------------------------
1 | {
2 | "gcServer": true
3 | }
--------------------------------------------------------------------------------
/samples/Bootstrap3Mvc6.Sample/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/Bootstrap4Mvc6.Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp1.0
5 | true
6 | Bootstrap4Mvc6.Sample
7 | Exe
8 | Bootstrap4Mvc6.Sample
9 | 1.0.4
10 |
11 |
12 |
13 |
14 | PreserveNewest
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/Models/DemoModelOne.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 |
4 | namespace Bootstrap4Mvc6.Sample.Models
5 | {
6 | public class DemoModelOne
7 | {
8 | [Display(Name = "Some string")]
9 | public string StringField { get; set; }
10 |
11 | [Display(Name = "Some bool")]
12 | public bool BooleanField { get; set; }
13 |
14 | [Display(Name = "Some int")]
15 | public int IntegerField { get; set; }
16 |
17 | public DateTimeOffset DateTimeOffsetField { get; set; } = DateTimeOffset.Now;
18 |
19 | public string FieldWithError { get; set; }
20 |
21 | public bool BooleanFieldWithError { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:65412/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "launchUrl": "/",
15 | "environmentVariables": {
16 | "ASPNETCORE_ENVIRONMENT": "Development"
17 | }
18 | },
19 | "Bootstrap4Mvc6.Sample": {
20 | "commandName": "Project",
21 | "launchBrowser": true,
22 | "launchUrl": "http://localhost:5000",
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/Views/Home/Basics.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Basics of BootstrapMvc";
3 | }
4 |
5 | @ViewBag.Title
6 |
7 | This page is under construction
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/Views/Home/Extend.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Extending BootstrapMvc";
3 | }
4 |
5 | @ViewBag.Title
6 |
7 | This page is under construction
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/Views/Home/FormPartial.cshtml:
--------------------------------------------------------------------------------
1 | @model Bootstrap4Mvc6.Sample.Models.DemoModelOne
2 | @{
3 | using (Bootstrap.BeginFormFieldset("Fieldset in partial subview"))
4 | {
5 | using (Bootstrap.FormGroupFor(m => m.StringField).Label("Field with complex content").WithSizedControls().BeginContent())
6 | {
7 | @Bootstrap.Input().Size(6, 6, 6, 6, 6)
8 | @Bootstrap.HelpBlock("Some text about this control")
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/Views/Home/Installation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "BootstrapMvc: Installation";
3 | }
4 |
5 | @ViewBag.Title
6 |
7 | 1. Add dependency to project.json
8 |
9 |
10 | "dependencies": {
11 | ....
12 | "BootstrapMvc.Bootstrap4Mvc6": "1.0.0"
13 | }
14 |
15 |
16 | 2. Update Views\_ViewImports.cshtml
file
17 |
18 |
19 | Add two lines to Views\_ViewImports.cshtml
file:
20 |
@@using BootstrapMvc
21 | @@inject BootstrapMvc.Mvc6.BootstrapHelper<TModel> Bootstrap
22 |
23 |
24 | 3. Register in DI container
25 |
26 |
27 | Append to ConfigureServices()
method in Startup.cs
:
28 |
services.AddTransient(typeof(BootstrapMvc.Mvc6.BootstrapHelper<>));
29 |
30 |
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using BootstrapMvc
2 | @using Microsoft.AspNetCore.Html;
3 | @inject BootstrapMvc.Mvc6.BootstrapHelper Bootstrap
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/runtimeconfig.template.json:
--------------------------------------------------------------------------------
1 | {
2 | "gcServer": true
3 | }
--------------------------------------------------------------------------------
/samples/Bootstrap4Mvc6.Sample/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/BootstrapMvc.Bootstrap3/AnyContentElements/Badge.cs:
--------------------------------------------------------------------------------
1 | namespace BootstrapMvc
2 | {
3 | using BootstrapMvc.Core;
4 |
5 | public class Badge : AnyContentElement
6 | {
7 | protected override string WriteSelfStartTag(System.IO.TextWriter writer)
8 | {
9 | var tb = Helper.CreateTagBuilder("span");
10 | tb.AddCssClass("badge");
11 |
12 | ApplyCss(tb);
13 | ApplyAttributes(tb);
14 |
15 | tb.WriteStartTag(writer);
16 |
17 | return tb.GetEndTag();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/BootstrapMvc.Bootstrap3/AnyContentElements/BadgeExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace BootstrapMvc
2 | {
3 | using System;
4 | using BootstrapMvc.Core;
5 |
6 | public static class BadgeExtensions
7 | {
8 | #region Generation
9 |
10 | public static IItemWriter Badge(this IAnyContentMarker contentHelper, object content)
11 | {
12 | return contentHelper.CreateWriter().Content(content);
13 | }
14 |
15 | #endregion
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/BootstrapMvc.Bootstrap3/AnyContentElements/Label.cs:
--------------------------------------------------------------------------------
1 | namespace BootstrapMvc
2 | {
3 | using BootstrapMvc.Core;
4 |
5 | public class Label : AnyContentElement
6 | {
7 | public LabelType Type { get; set; }
8 |
9 | protected override string WriteSelfStartTag(System.IO.TextWriter writer)
10 | {
11 | var tb = Helper.CreateTagBuilder("span");
12 | tb.AddCssClass(Type.ToCssClass());
13 |
14 | ApplyCss(tb);
15 | ApplyAttributes(tb);
16 |
17 | tb.WriteStartTag(writer);
18 |
19 | return tb.GetEndTag();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/BootstrapMvc.Bootstrap3/AnyContentElements/LabelExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace BootstrapMvc
2 | {
3 | using System;
4 | using BootstrapMvc.Core;
5 |
6 | public static class LabelExtensions
7 | {
8 | #region Fluent
9 |
10 | public static IItemWriter Type(this IItemWriter target, LabelType value) where T : Label
11 | {
12 | target.Item.Type = value;
13 | return target;
14 | }
15 |
16 | #endregion
17 |
18 | #region Generation
19 |
20 | public static IItemWriter