Skip to content
Helpful TagHelpers for any ASP.NET Core project (Paging, Select-Enum, etc).
C# HTML
Branch: master
Clone or download
Latest commit 3fc9ccf Jun 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates Feb 14, 2019
LazZiya.TagHelpers hotfix : see issue #2 Jun 19, 2019
.gitattributes
.gitignore Add .gitignore and .gitattributes. Sep 9, 2018
LICENSE Create LICENSE Sep 9, 2018
README.md new hotfix release Jun 20, 2019
ReleseHistory.md
TagHelpers.sln todo: ExpressLocalization TagHelper component May 23, 2019
_config.yml Set theme jekyll-theme-cayman Feb 14, 2019

README.md

LazZiya.TagHelpers

Collection of helpful TagHelpers for any ASP.NET Core project.

Latest release

20 June 2019

Contents

Installation:

Install via nuget :

Install-Package LazZiya.TagHelpers -Version 2.2.1

add tag helper to _ViewImports.cshtml:

@addTagHelper *, LazZiya.TagHelpers

Code Samples

Localize TagHelper

Use simple html tag to localize text/html in razor views

<localize>Hellow world!</localize>

Requires LazZiya.TagHelpers.Localization and LazZiya.ExpressLocalization nuget packages.

Read more:

Alert TagHelper

Easily create bootstrap 4.x alerts from c# backend or razor pages using html codes. All bootstrap alerts can be created from both ends (Primary, Secondary, Success, Info, Warning, Danger, Light, Dark).

Create alert from razor page using HTML

<alert-success>Congratulations! you have done the job!</alert-success>

Create alert from c# backend

Alert are TempData items, so they will be disposed once they are fetched. You can create alerts from the c# backend by the provided extension methods for TempData as below:

using LazZiya.TagHelpers.Alerts

TempData.Danger("Ooopps! something went wrong with the code, please contact support.");

Then use alert tag helepr on razor side to render the alerts:

<alert view-context="ViewContext"></alert>

Read more :

LocalizationValidationScripts TagHelper

will add all required js files and code to validate localized input fields like numbers, date and currency. These scripts will help to validate localized decimal numbers with comma or dot format (e.g. EN culture: 1.2 - TR culture: 1,2).

1- Register tag helper component in startup. Don't apply this step if you are using ExpressLocalization it will be done automatically

services.AddTransient<ITagHelperComponent, LocalizationValidationScriptsTagHelperComponent>()

2- Add this code to the scripts section in the page:

<localization-validation-scripts></localization-validation-scripts>

For more details :

LangaugeNav TagHelper

<language-nav view-context="ViewContext"></language-nav>

For more details :

SelectEnum TagHelper

Sample enum :

public enum WeekDays { MON, TUE, WED, THU, FRI, SAT, SUN }

create the related select list dropdown in razor page :

<select-enum 
        enum-type="typeof(WeekDays)" 
        name="weekDay">
</select-enum>

For more details :

Paging TagHelper

Only few parameters are required to fireup the agination control

<paging total-records="Model.TotalRecords"
        page-no="Model.PageNo"
        query-string-value="@(Request.QueryString.Value)"
        show-prev-next="true">
</paging>

it is important to add query-string-value if there is multiple filtering parameters in the url.

For more details :

Project site:

http://ziyad.info/en/articles/27-LazZiya_TagHelpers

Live Demos :

http://demo.ziyad.info/en/

License

https://github.com/LazZiya/TagHelpers/blob/master/LICENSE

You can’t perform that action at this time.