LazZiya.TagHelpers 3.1.0

Collection of tag helpers for ASP.NET Core web applications, like Paging, SelectEnum and LanguageNav dropdown tag helpers for MVC and Razor Pages.

There is a newer version of this package available.
See the version list below for details.
Install-Package LazZiya.TagHelpers -Version 3.1.0
dotnet add package LazZiya.TagHelpers --version 3.1.0
<PackageReference Include="LazZiya.TagHelpers" Version="3.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LazZiya.TagHelpers --version 3.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LazZiya.TagHelpers, 3.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install LazZiya.TagHelpers as a Cake Addin
#addin nuget:?package=LazZiya.TagHelpers&version=3.1.0

// Install LazZiya.TagHelpers as a Cake Tool
#tool nuget:?package=LazZiya.TagHelpers&version=3.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

LazZiya.TagHelpers

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

Latest release

18 December 2019

  • v3.1.0
  • Support for .NeT Core 3.1
  • PagingTagHelper : query-string-value not required to be passed as parameter, it will be assigned automatically by ViewContext in the tag helper.
  • PagingTagHelper : All opitons are on by default, can be turned off manually if not needed. See Demo page for more details about all options.

Contents

Installation:

Install via nuget :

Install-Package LazZiya.TagHelpers

add tag helper to _ViewImports.cshtml:

@addTagHelper *, LazZiya.TagHelpers

Code Samples

Paging TagHelper

Only few parameters are required to fireup the agination control

  • version >= 3.1.0
<paging total-records="Model.TotalRecords"
        page-no="Model.PageNo">
</paging>
  • version ⇐ 3.0.2
<paging total-records="Model.TotalRecords"
        page-no="Model.PageNo"
        query-string-value="@(Request.QueryString.Value)">
</paging>

it is important to add query-string-value for versions before 3.1.0.

For more details :

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:

  • version >= 3.0.1
<alert></alert>
  • version ⇐ 3.0.0
<alert view-context="ViewContext"></alert>

Read more :

LangaugeNav TagHelper

  • version >= 3.0.1
<language-nav></language-nav>
  • version ⇐ 3.0.0
<language-nav view-context="ViewContext"></language-nav>

For more details :

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 :

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 :

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

LazZiya.TagHelpers

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

Latest release

18 December 2019

  • v3.1.0
  • Support for .NeT Core 3.1
  • PagingTagHelper : query-string-value not required to be passed as parameter, it will be assigned automatically by ViewContext in the tag helper.
  • PagingTagHelper : All opitons are on by default, can be turned off manually if not needed. See Demo page for more details about all options.

Contents

Installation:

Install via nuget :

Install-Package LazZiya.TagHelpers

add tag helper to _ViewImports.cshtml:

@addTagHelper *, LazZiya.TagHelpers

Code Samples

Paging TagHelper

Only few parameters are required to fireup the agination control

  • version >= 3.1.0
<paging total-records="Model.TotalRecords"
        page-no="Model.PageNo">
</paging>
  • version ⇐ 3.0.2
<paging total-records="Model.TotalRecords"
        page-no="Model.PageNo"
        query-string-value="@(Request.QueryString.Value)">
</paging>

it is important to add query-string-value for versions before 3.1.0.

For more details :

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:

  • version >= 3.0.1
<alert></alert>
  • version ⇐ 3.0.0
<alert view-context="ViewContext"></alert>

Read more :

LangaugeNav TagHelper

  • version >= 3.0.1
<language-nav></language-nav>
  • version ⇐ 3.0.0
<language-nav view-context="ViewContext"></language-nav>

For more details :

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 :

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 :

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

Release Notes

- Support for DotNetCore 3.1
     - PagingTagHelper: query-string-value is not required to be passed as parameter,
     - PagingTagHelper: All options are on, switch off manually if not needed.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LazZiya.TagHelpers:

Package Downloads
XLocalizer.DB.UI
Interface for managing localization with XLocalizer package and ability to use online translation tools.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
5.0.0 3,019 11/12/2020
5.0.0-rc.1 109 11/5/2020
5.0.0-preview2 353 8/10/2020
5.0.0-preview1 258 7/26/2020
5.0.0-beta1 592 6/1/2020
4.0.1 12,552 4/5/2020
4.0.0 555 3/27/2020
4.0.0-preview2 243 2/27/2020
4.0.0-preview1 494 2/20/2020
3.1.2 1,358 1/13/2020
3.1.1 230 1/10/2020
3.1.0 1,598 12/18/2019
3.1.0-preview2 246 12/4/2019
3.1.0-preview1 240 11/11/2019
3.0.2 1,751 10/16/2019
3.0.1 724 10/2/2019
3.0.0 605 9/25/2019
3.0.0-preview1 325 9/2/2019
2.2.1 2,792 6/20/2019
2.2.0 543 6/7/2019
2.1.0 517 5/26/2019
2.0.0 1,431 4/13/2019
2.0.0-rc2 258 4/13/2019
2.0.0-rc1 291 4/13/2019
1.0.3 2,336 2/10/2019
1.0.2 860 9/14/2018
1.0.0 423 9/9/2018
Show less