Skip to content

Commit 4499fdb

Browse files
Merge pull request #3 from IowaComputerGurus/feature/input-tag-helper-addition
Initial Adjustments to BS5
2 parents 4ae855d + f4b88e8 commit 4499fdb

File tree

43 files changed

+776
-359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+776
-359
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ At this time tag helpers have been implemented for the following elements.
6666
| --- | --- |
6767
| Alerts | Full support for implementation of alerts, including dismissible alerts |
6868
| Badges | Full support for implementation of badges of all Bootstrap color variations |
69+
| Buttons | Full support for implementation of buttons of all Bootstrap color variations, including outlines |
6970
| Cards | Support for Card, Card Header, Card Header Actions, and Card body elements |
7071
| Environment Alert | An extension of the `<environment>` tag helper to render as an alert style |
7172
| Input | Support for Form input controls for anything tied to the `<input>` tag including ASP.NET Code Model Binding & Validation |

src/AspNetCore.Utilities.Bootstrap5TagHelpers.Sample/Controllers/HomeController.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,31 @@ public HomeController(ILogger<HomeController> logger)
1515

1616
public IActionResult Index()
1717
{
18-
return View();
18+
return View(new SampleModel());
19+
}
20+
21+
[HttpGet]
22+
public IActionResult StandardForm()
23+
{
24+
return View(new SampleModel());
25+
}
26+
27+
[HttpGet]
28+
public IActionResult StandardFormStyled()
29+
{
30+
return View(new SampleModel());
31+
}
32+
33+
[HttpPost]
34+
public IActionResult StandardForm(SampleModel model)
35+
{
36+
return View(model);
37+
}
38+
39+
[HttpPost]
40+
public IActionResult StandardFormStyled(SampleModel model)
41+
{
42+
return View(model);
1943
}
2044

2145
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]

src/AspNetCore.Utilities.Bootstrap5TagHelpers.Sample/Models/SampleModel.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@ namespace AspNetCore.Utilities.Bootstrap5TagHelpers.Sample.Models
44
{
55
public class SampleModel
66
{
7-
[Display(Name = "Your Name")]
7+
[Display(Name = "First Name")]
88
[Required]
99
[MaxLength(50)]
10-
public string Name { get; set; } = "";
10+
public string FirstName { get; set; } = "";
11+
12+
[Display(Name = "Last Name")]
13+
[Required]
14+
[MaxLength(50)]
15+
public string LastName { get; set; } = "";
1116

1217
[Display(Name = "Email Address")]
1318
[Required]
1419
[EmailAddress]
1520
public string Email { get; set; } = "";
1621

22+
[Display(Name = "City")]
23+
public string City { get; set; } = "";
24+
1725
[Display(Name = "Password")]
1826
[DataType(DataType.Password)]
1927
[Required]
@@ -25,5 +33,11 @@ public class SampleModel
2533
[Display(Name = "Country")]
2634
[Required]
2735
public int SelectedCountry { get; set; }
36+
37+
[Display(Name = "ReadOnly")]
38+
public string ReadOnlyField { get; set; } = "Readonly Field Example";
39+
40+
[Display(Name = "Select List Item")]
41+
public SampleEnum SelectedListItem { get; set; }
2842
}
2943
}

0 commit comments

Comments
 (0)