Keep changing active bootstrap on every button click - c#

I am using bootstrap tabs. There are 6 tabs and the 1st tab is active on page load.
<ul class="nav">
<li class="nav-link active"><a data-toggle="tab" href="#menu1">People</a></li>
<li><a data-toggle="tab" href="#menu2">Current Performance</a></li>
<li><a data-toggle="tab" href="#menu3">Tools</a></li>
<li><a data-toggle="tab" href="#menu4">Collaboration Enablers</a></li>
<li><a data-toggle="tab" href="#menu5">Infrastructure</a></li>
<li><a data-toggle="tab" href="#menu6">Practices</a></li>
</ul>
Now i have a grid-view for with some labels, radio buttons and Next and previous buttons.
So i want the active tab to change every time i click next button. How to do that?
Initially PEOPLE tab is active. On next click CURRENT PERFORMANCE should be active.

Related

Blazor Menu keeping Menu Highlight (Active) for Child Detail Page

I have a table with list of items on a "List Page". Then when you select "View Detail" link on a row it should show the detail of that row item in a child "Detail Page".
Home
ListPage (I want to keep this Active)
DetailPage (This is not on the Menu since it's child page of ListPage)
List Page
Id
Title
Action
1
My Item 1
View Detail
2
My Item 2
View Detail
Currently my Blazor Menu looks like this:
Menu
Home
List Page
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="oi oi-home" aria-hidden="true"></span> #Loc["Home"]
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="ListPage">
<span class="oi oi-list-rich" aria-hidden="true"></span> #Loc["ListPage"]
</NavLink>
</div>
How do I keep the highlight of "List Page" on the menu when we go to the "View Detail" sub page in the table of List Page?
The default for <NavLink... does the this. It is the point of the Match parameter wich defaults to NavLinkMatch.Prefix if omitted. If your route is #page "/ListPage" then your child pages should use the route #page "/ListPage/{SomeParameter}" or similar. NavLink will then work as the route starts with "/ListPage".
NavLink Source Code

How to click on a tab with specific text?

I need to click on tab "Pis/Cofins" in my application
<ul class="nav nav-tabs" id="tabs">
<li class="">
Dados Gerais
</li>
<li class="active">
Pis/Cofins
</li>
<li>
Combustíveis
</li>
<li>
Modo de Servir
</li>
<li>
Imagens
</li>
<li>
Informações
</li>
</ul>
You may simply use the following xpath:
//a[text()='Pis/Cofins']
You may use extension like Firebug in firefox to easily find locators and use them in your test scripts
As per the HTML you have shared to click on tab with text as Pis/Cofins you can use either of the following solutions:
LinkText:
driver.FindElement(By.LinkText("Pis/Cofins")).Click();
CssSelector:
driver.FindElement(By.CssSelector("ul.nav.nav-tabs#tabs a[href$='pisCofins']")).Click();
XPath:
driver.FindElement(By.XPath("//a[contains(#href,'pisCofins') and contains(.,'Pis/Cofins')]")).Click();

ASP.Net Faulty Link Creation

I have just created a link to route in Site.Master but it have created a weird error
For example, when it was clicked, instead of http://localhost/Admin/ManageType it became http://localhost/~/Admin/ManageType.
I have tried to solve it myself by removing ~/ and it works but it come with a flaw. Once click it work and bring you to the page but when click again, it become http://localhost/Admin/Admin/ManageType instead of http://localhost/~/Admin/ManageType.
<ul class="nav navbar-nav">
<li><a runat="server" href="~/">Home</a></li>
<li><a runat="server" href="~/About">About</a></li>
<li class="dropdown">
Manage <b class="caret"></b>
<ul class="dropdown-menu">
<li>Recipe</li>
<li class="divider"></li>
<li>Type</li>
</ul>
</li>
<li><a runat="server" href="~/Recipe/Recipe">Recipe</a></li>
</ul>
Use Control.ResolveUrl method instead.
And you need to change:
<li>Recipe</li>
To:
<li><a href="<%= Page.ResolveUrl("~/Admin/ManageType") %>" title="ManageType" >ManageType</a></li>
Try this:
<li>Type</li>

Dropdown master page didn't work after change page

Didn't work dropdownlist Risk Content in master page after change page to the setting page. The dropdown just work after go back to home page again
MasterPage.master
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav custom_nav">
<li class="">Home
</li>
<li class="dropdown">Risk Context
<ul class="dropdown-menu" role="menu">
<li>Objective (KPI)
</li>
<li>Risk Limit & Expected Residual Risk
</li>
<li>Impact Scale Tables
</li>
<li>Probability Scale Tables
</li>
</ul>
</li>
<li>Settings
</li>
<ul>
</div>
What I miss from my code?? help me. thank before..

Styling orchard menu with custom css

Currently I am implementing an existing layout already implemented in MVC4 project.
I am struggling with how to implement a custom menu in the latest Orchard (using the source version so Orchard runs in Visual Studio).
The problem is where does the CSS get applied? The only thing I could find with google was changing the Menu.cshtml (one in core/shapes one in admin theme, clueless which one is the proper one). I cannot see any sign of css anywhere.
The html version of my menu has the following look:
<div id="cssmenu" class="fixedContentSize">
<ul>
<li class='active '><a href='index.html'><span>Home</span></a></li>
<li class='has-sub '><a href='#'><span>Dojo</span></a>
<ul>
<li class='has-sub '><a href='#'><span>Test</span></a>
<ul>
<li><a href='#'><span>Sub Item</span></a></li>
<li><a href='#'><span>Sub Item</span></a></li>
</ul>
</li>
<li class='has-sub '><a href='#'><span>Test2</span></a>
<ul>
<li><a href='#'><span>Sub Item</span></a></li>
<li><a href='#'><span>Sub Item</span></a></li>
</ul>
</li>
</ul>
</li>
<li><a href='#'><span>Media</span></a></li>
<li><a href='#'><span>Links</span></a></li>
<li><a href='#'><span>About</span></a></li>
<li><a href='#'><span>Contact</span></a></li>
</ul>
</div>
It gets applied in the theme's CSS. Look at site.css in the theme machine theme for an example.

Categories