meta info
- Title: AlertTagHelper - Frontend Alerts
- Keywords: asp.net-core, taghelpers, alerts, backend
- Description: Create bootstrap alerts from frontend with LazZiya.TagHelpers.
- Author: Ziya Mollamahmut
- Date: 27-Nov-2021
- Image: https://github.com/LazZiya/Docs/raw/master/LazZiya.TagHelpers/v6.0/images/lazziya-tagheleprs-logo.png
- Image-alt: LazZiya.TagHelpers Logo
- Version: v6.0
Install nuget package
Install-Package LazZiya.TagHelpers
Add taghelpers in _ViewImports.cshtml
@addTagHelper *, LazZiya.TagHelpers
Create bootstrap 4.x themed alerts with simple html tag.
<alert-primary>
This is a primary alert from the front end.
</alert-primary>
Use dismissable
attribute to remove the alert closing button.
<alert-info dismissable="false">
This an alert that can't be dismissed!
</alert-info>
Add alert header using alert-heading
attribute
<alert-warning alert-heading="Warning!">
This is a warning alert with header.
</alert-warning>
It is possible to use html content inside the alert body.
<alert-danger>
<h3>Danger alert</h3>
<p>This is a danger alert with html content.</p>
<hr />
<p class="text-dark">Use your creativity to style the content as you wish.</p>
</alert-danger>
<alert-primary>
<alert-secondary>
<alert-success>
<alert-info>
<alert-warning>
<alert-danger>
<alert-light>
<alert-dark>
See samples in the demo page.