This collection of Tag Helpers will evolve and expand over time. For now, it includes the following:
-
<link-button>
- Produces an anchor element which posts the form in which it's placed. Brings ASP.NET 4.x Web Forms LinkButton control behavior to ASP.NET Core MVC and Razor Pages.Consider the following markup in the Index.cshtml file of a Razor Pages app:
<form asp-page-handler="Post"> <link-button>Test Link</link-button> </form>
When clicked, the associated page model's
OnPost
handler is invoked:public class IndexModel : PageModel { public void OnPost() { } }
-
Add a reference to the NuGet package:
dotnet add package TagHelperSuite
-
Restore NuGet package:
dotnet restore
-
Register the Tag Helpers in _ViewImports.cshtml:
@addTagHelper *, TagHelperSuite
Credit goes to Isaac Levin for the idea that lead to the creation of the <link-button>
Tag Helper.