LazZiya.TagHelpers 3.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package LazZiya.TagHelpers --version 3.1.0                
NuGet\Install-Package LazZiya.TagHelpers -Version 3.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<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                
#r "nuget: LazZiya.TagHelpers, 3.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. 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                

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

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 is compatible.  netcoreapp2.2 is compatible.  netcoreapp3.0 is compatible.  netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 (1)

Showing the top 1 popular GitHub repositories that depend on LazZiya.TagHelpers:

Repository Stars
teduinternational/eShopSolution
eShopSolution is a tutorial solution for everyone using .NET Core 3.1
Version Downloads Last updated
6.0.2 59,150 5/4/2022
6.0.1 10,689 12/19/2021
6.0.0 4,394 11/27/2021
5.0.0 49,348 11/12/2020
5.0.0-rc.1 251 11/5/2020
5.0.0-preview2 657 8/10/2020
5.0.0-preview1 637 7/26/2020
5.0.0-beta1 2,675 6/1/2020
4.0.1 27,129 4/5/2020
4.0.0 1,065 3/27/2020
4.0.0-preview2 588 2/27/2020
4.0.0-preview1 840 2/20/2020
3.1.2 2,616 1/13/2020
3.1.1 787 1/10/2020
3.1.0 4,502 12/18/2019
3.1.0-preview2 542 12/4/2019
3.1.0-preview1 1,173 11/11/2019
3.0.2 2,874 10/16/2019
3.0.1 1,212 10/2/2019
3.0.0 3,306 9/25/2019
3.0.0-preview1 1,717 9/2/2019
2.2.1 5,654 6/20/2019
2.2.0 2,026 6/7/2019
2.1.0 3,031 5/26/2019
2.0.0 2,367 4/13/2019
2.0.0-rc2 548 4/13/2019
2.0.0-rc1 603 4/13/2019
1.0.3 2,981 2/10/2019
1.0.2 1,969 9/14/2018
1.0.0 1,038 9/9/2018

- 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.