ActivateMenu 1.0.2
dotnet add package ActivateMenu --version 1.0.2
NuGet\Install-Package ActivateMenu -Version 1.0.2
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="ActivateMenu" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ActivateMenu --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ActivateMenu, 1.0.2"
#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 ActivateMenu as a Cake Addin #addin nuget:?package=ActivateMenu&version=1.0.2 // Install ActivateMenu as a Cake Tool #tool nuget:?package=ActivateMenu&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Activate Menu
This library will help you with the menu to add an "active" class whenever the page is loaded or clecked
Getting started
To start using this package, follow below steps:-
- Install NuGet Package from the source
- Add the library on your project by name as "using Joka.ActivateMenu" or "using Joka"
- On your view for navbar
Syntax to be used in View pages
- For parent menu - @Html.IsMenuActive("controller", "cssClass") 2.
- For sub menu - @Html.IsActive("controller", "action", "cssClass")
Note: cssClass can be replaced with your custom css class or else it will use default css class on keeping it blank as "active" on parent and "active_submenu" on child
E.g.
<nav class="mainmenu_side_wrapper">
<h3 class="dark_bg_color">Dashboard</h3>
<ul class="menu-click">
<li class="active">
<a asp-area="Admin" asp-action="Index" asp-controller="Dashboard">
<i class="fa fa-th-large"></i>
Dashboard
</a>
</li>
</ul>
<h3 class="dark_bg_color">Manage</h3>
<ul class="menu-click">
<li class="active">
<a href="">
<i class="fa fa-file-text"></i>
News1
</a>
<ul>
<li class="active_submenu">
<a asp-area="Admin" asp-action="Index" asp-controller="News1">
News
</a>
</li>
<li class="active_submenu">
<a asp-area="Admin" asp-action="Create" asp-controller="News1">
Create News1
</a>
</li>
</ul>
</li>
<li class="active">
<a href="">
<i class="fa fa-file-text"></i>
News2
</a>
<ul>
<li class="active_submenu)">
<a asp-area="Admin" asp-action="Index" asp-controller="News2">
News
</a>
</li>
<li class="active_submenu">
<a asp-area="Admin" asp-action="Create" asp-controller="News2">
Create News2
</a>
</li>
</ul>
</li>
</ul>
</nav>
above can be done as
<nav class="mainmenu_side_wrapper">
<h3 class="dark_bg_color">Dashboard</h3>
<ul class="menu-click">
<li class="@Html.IsMenuActive("Dashboard", "active")">
<a asp-area="Admin" asp-action="Index" asp-controller="Dashboard">
<i class="fa fa-th-large"></i>
Dashboard
</a>
</li>
</ul>
<h3 class="dark_bg_color">Manage</h3>
<ul class="menu-click">
<li class="@Html.IsMenuActive("Article", "active")">
<a href="">
<i class="fa fa-file-text"></i>
Article
</a>
<ul>
<li class="@Html.IsActive("Article","Index", "active_submenu")">
<a asp-area="Admin" asp-action="Index" asp-controller="Article">
Articles
</a>
</li>
<li class="@Html.IsActive("Article","Create", "active_submenu")">
<a asp-area="Admin" asp-action="Create" asp-controller="Article">
Create Article
</a>
</li>
</ul>
</li>
<li class="@Html.IsMenuActive("News", "active")">
<a href="">
<i class="fa fa-file-text"></i>
News
</a>
<ul>
<li class="@Html.IsActive("News","Index", "active_submenu")">
<a asp-area="Admin" asp-action="Index" asp-controller="News">
News
</a>
</li>
<li class="@Html.IsActive("News","Create", "active_submenu")">
<a asp-area="Admin" asp-action="Create" asp-controller="News">
Create News
</a>
</li>
</ul>
</li>
</ul>
</nav>
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 | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Microsoft.AspNetCore.Mvc.ViewFeatures (>= 2.2.0)
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.2 | 317 | 1/27/2022 |