RGHB.TagHelpers 1.11.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package RGHB.TagHelpers --version 1.11.1
                    
NuGet\Install-Package RGHB.TagHelpers -Version 1.11.1
                    
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="RGHB.TagHelpers" Version="1.11.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RGHB.TagHelpers" Version="1.11.1" />
                    
Directory.Packages.props
<PackageReference Include="RGHB.TagHelpers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RGHB.TagHelpers --version 1.11.1
                    
#r "nuget: RGHB.TagHelpers, 1.11.1"
                    
#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.
#:package RGHB.TagHelpers@1.11.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RGHB.TagHelpers&version=1.11.1
                    
Install as a Cake Addin
#tool nuget:?package=RGHB.TagHelpers&version=1.11.1
                    
Install as a Cake Tool

RGHB TagHelpers

A collection of ASP.NET Core TagHelpers designed to simplify common tasks in web applications, such as table row operations, image handling, file size formatting, and pagination.

Installation

  1. Add the NuGet package to your project:

    dotnet add package RGHB.TagHelpers --version 1.1.0
    
  2. Register the tag helpers in your _ViewImports.cshtml:

    @addTagHelper *, RGHB.TagHelpers
    
  3. Ensure you have Bootstrap and Phosphor Icons (or equivalent CSS classes) included in your project for styling and icons.

Tag Helpers

1. rghb-delete-table-row

Generates a delete button that triggers a Bootstrap modal for confirming deletion.

Attributes:

  • url: The URL for the delete action.
  • id: The ID of the item to delete.

Example:

<rghb-delete-table-row url="/Controller/Delete" id="123"></rghb-delete-table-row>

Output: A button with a trash icon that opens a modal with data-id and data-action attributes.

Note: You need to include a Bootstrap modal with the ID deleteConfirmationModal and handle the delete action via JavaScript.

2. rghb-edit-table-row

Generates an edit link with an icon for a table row.

Attributes:

  • url: The URL for the edit action.

Example:

<rghb-edit-table-row url="/Controller/Edit/123"></rghb-edit-table-row>

Output: An anchor tag with a pencil icon and a localized "Edit" title.

3. rghb-IsChecked

Displays a check or cross icon based on a boolean value.

Attributes:

  • is-checked: The boolean value to display (true for check, false for cross).
  • css-class: The CSS class for the icon.

Example:

<rghb-IsChecked is-checked="true" css-class="ph ph-check"></rghb-IsChecked>

Output: A check icon for true or a cross icon for false, styled with the provided CSS class.

4. img (with fallback-src)

Handles image loading with a fallback source if the original image is unavailable.

Attributes:

  • src: The source path of the image.
  • fallback-src: The fallback image source path.

Example:

<img src="~/images/photo.jpg" fallback-src="~/images/default.jpg" />

Output: An img tag with the src set to the original image if it exists, or the fallback image otherwise.

5. rghb-filesize

Formats a file size in KB or MB for display.

Attributes:

  • size: The file size in kilobytes (KB).

Example:

<rghb-filesize size="2048"></rghb-filesize>

Output: A span tag displaying "2 MB" (or "2048 KB" if less than 1024 KB).

6. rghb-table-paging

Generates a pagination control for a table with previous/next links and page information.

Attributes:

  • current-page: The current page number.
  • total-pages: The total number of pages.
  • total-item: The total number of items.
  • paging-action: The action name for paging links.
  • paging-controller: The controller name for paging links.
  • paging-area: The area name for paging links (optional).

Example:

<rghb-table-paging current-page="1" total-pages="5" total-item="50" paging-action="Index" paging-controller="Home" paging-area=""></rghb-table-paging>

Output: A Bootstrap pagination control with previous/next links and a summary of the current page and total items.

Dependencies

  • .NET 9.0
  • Microsoft.AspNetCore.Mvc.TagHelpers
  • Microsoft.Extensions.Localization
  • Microsoft.AspNetCore.Mvc.Core
  • Bootstrap (for styling)
  • Phosphor Icons (for icons)

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.14.1 116 8/31/2025
1.14.0 169 8/30/2025
1.13.0 170 8/30/2025
1.12.0 172 8/27/2025
1.11.1 181 8/26/2025
1.11.0 190 8/26/2025
1.10.0 187 8/26/2025
1.9.0 113 8/24/2025
1.8.2 53 8/23/2025
1.8.1 124 8/18/2025
1.8.0 128 8/18/2025
1.7.0 112 8/9/2025
1.6.6 197 8/5/2025
1.6.5 65 8/3/2025
1.6.4 70 8/3/2025
1.6.2 68 8/3/2025
1.6.1 63 8/3/2025
1.6.0 66 8/3/2025
1.5.1 67 8/3/2025
1.5.0 47 8/3/2025
1.4.0 99 7/30/2025
1.3.0 96 7/29/2025
1.2.1 95 7/29/2025
1.2.0 137 6/26/2025
1.1.0 107 6/22/2025