Cypal.TagHelpers 1.0.0

dotnet add package Cypal.TagHelpers --version 1.0.0
                    
NuGet\Install-Package Cypal.TagHelpers -Version 1.0.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="Cypal.TagHelpers" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cypal.TagHelpers" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Cypal.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 Cypal.TagHelpers --version 1.0.0
                    
#r "nuget: Cypal.TagHelpers, 1.0.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.
#:package Cypal.TagHelpers@1.0.0
                    
#: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=Cypal.TagHelpers&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Cypal.TagHelpers&version=1.0.0
                    
Install as a Cake Tool

Cypal ASP Utils: Tag-Helpers

Role based authorization is a powerful model in ASP Core to restrict who does what. This is applied at a Razor Page or Controller level. There is no simpler way of providing the similar access to individual controls. This library aims to provide Role based controlls for the individual form fields.

Overview

The form fields are created with Razor's Tag Helpers. This library adds two features show/hide and edit/read-only features for the form fields.

Installation

This library is available as a NuGet package. You can install it using the NuGet Package Console window:

PM> Install-Package Cypal.TagHelpers

No other initialization is required.

Usage

Show/Hide

Showing or hiding based on the Roles will be done on the div/ul/li/span elements.



<li class="nav-item" asp-shown-for="Admin,Developer">
    <a asp-page="/AdminDashboard/Index" class="nav-link">Admin Dashboard</a>
</li>


<div class="form-group" asp-hidden-for="DataEntryOperator">
    <label asp-for="Model.SomeField"></label>
    <input asp-for="Model.SomeField" class="form-control">
    <span asp-validation-for="Model.SomeField" class="text-danger"></span>
</div>

Edit/Read-Only

Editing or Read-Only is applicable for form field elements.



<div class="form-group ">
    <label asp-for="Model.SomeField"></label>
    <input asp-for="Model.SomeField" class="form-control" asp-editable-for="Admin" >
    <span asp-validation-for="Model.SomeField" class="text-danger"></span>
</div>


<div class="form-group ">
    <label asp-for="Model.SomeField"></label>
    <input asp-for="Model.SomeField" class="form-control" asp-readonly-for="OfficeStaff" >
    <span asp-validation-for="Model.SomeField" class="text-danger"></span>
</div>

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.  net9.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
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.0.0 4,097 4/1/2020