LazZiya.TagHelpers
3.1.0
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
<PackageReference Include="LazZiya.TagHelpers" Version="3.1.0" />
paket add LazZiya.TagHelpers --version 3.1.0
#r "nuget: LazZiya.TagHelpers, 3.1.0"
// 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
- LocalizeTagHelper (Repository, Demo, Tutorial)
- AlertTagHelper (Docs, Demo)
- LocalizationValidationScriptsTagHelper (Docs, Demo)
- LanguageNavTagHelper (Docs, Demo)
- SelectEnumTagHelper (Docs, Demo)
- PagingTagHelper (Docs, Demo, Tutorial)
- EmailTagHelper
- PhoneNumberTagHelper
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:
- Demo
- Repository
- LazZiya.ExpressLocalization
- Step-by-step tutorial to develop multi-cultural Asp.Net Core 2.2 web app
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 :
License
Product | Versions 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. |
-
.NETCoreApp 2.0
- Microsoft.AspNetCore.Localization (>= 2.0.0)
- Microsoft.AspNetCore.Mvc.TagHelpers (>= 2.0.0)
-
.NETCoreApp 2.1
- Microsoft.AspNetCore.Localization (>= 2.0.0)
- Microsoft.AspNetCore.Mvc.TagHelpers (>= 2.0.0)
-
.NETCoreApp 2.2
- Microsoft.AspNetCore.Localization (>= 2.0.0)
- Microsoft.AspNetCore.Mvc.TagHelpers (>= 2.0.0)
- Microsoft.AspNetCore.Routing (>= 2.2.0)
-
.NETCoreApp 3.0
- No dependencies.
-
.NETCoreApp 3.1
- No dependencies.
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,987 | 5/4/2022 |
6.0.1 | 10,714 | 12/19/2021 |
6.0.0 | 4,403 | 11/27/2021 |
5.0.0 | 49,419 | 11/12/2020 |
5.0.0-rc.1 | 253 | 11/5/2020 |
5.0.0-preview2 | 659 | 8/10/2020 |
5.0.0-preview1 | 639 | 7/26/2020 |
5.0.0-beta1 | 2,680 | 6/1/2020 |
4.0.1 | 27,159 | 4/5/2020 |
4.0.0 | 1,069 | 3/27/2020 |
4.0.0-preview2 | 590 | 2/27/2020 |
4.0.0-preview1 | 842 | 2/20/2020 |
3.1.2 | 2,624 | 1/13/2020 |
3.1.1 | 792 | 1/10/2020 |
3.1.0 | 4,509 | 12/18/2019 |
3.1.0-preview2 | 544 | 12/4/2019 |
3.1.0-preview1 | 1,175 | 11/11/2019 |
3.0.2 | 2,882 | 10/16/2019 |
3.0.1 | 1,214 | 10/2/2019 |
3.0.0 | 3,308 | 9/25/2019 |
3.0.0-preview1 | 1,719 | 9/2/2019 |
2.2.1 | 5,661 | 6/20/2019 |
2.2.0 | 2,031 | 6/7/2019 |
2.1.0 | 3,033 | 5/26/2019 |
2.0.0 | 2,371 | 4/13/2019 |
2.0.0-rc2 | 550 | 4/13/2019 |
2.0.0-rc1 | 605 | 4/13/2019 |
1.0.3 | 2,984 | 2/10/2019 |
1.0.2 | 1,971 | 9/14/2018 |
1.0.0 | 1,040 | 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.