Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.25 KB

README.md

File metadata and controls

29 lines (24 loc) · 1.25 KB

Pact.TagHelpers 🏷

Contains several general purpose ASP.NET Core TagHelpers (which replaced the old @helper Razor MVC feature).

Also contains a shared Razor Pages for the Account/AccessDenied route and an Alerts partial view, utilizing the AlertTagHelper.

Some examples follow:

Renders a Bootstrap 4 compatible alert (dead simple and fairly pointless but reduces ceremony somewhat)

<div alert-type="success" alert-message="You got this"></div>
<div alert-type="warning">Caution advised</div>

Simply conditional rendering of an element based on a boolean condition without needing to wrap it in a Razor "@if {}" block

<div condition="@myvariable">Something</div>

Should hopefully apply the correct set of arbitrary attributes to an input element that makes it behave in a read-only manner

<input type="text" is-read-only="@myvariable"/>
<input type="checkbox" is-read-only="@myvariable"/>
<input type="radio" is-read-only="@myvariable"/>
<select type="text" is-read-only="@myvariable">...</select>

The API Wiki can be found here