Introduction
Apply active CSS on menus on Master Pages from code behind without javascript.
In our web applications
We face problems when using a Master Page. How to set the class for the active tab?
Here we can set active class
- <ul>
- <li id="page1" runat="server" >
- <a href="studentHomePage.aspx"> Dashboard </a>
- </li>
- <li id="page2" runat="server">
- <a href="Mytest.aspx"> My Test</a>
- </li>
- <li id="page3" runat="server">
- <a href="TestReport.aspx">Test Report</a>
- </li>
- <li id="page4" runat="server">
- <a href="Subscription_New.aspx">Subscribe</a>
- </li>
- </ul>
Asad MalikPosted Aug 27, 2020, 1:45 PM
I have multiple pages..[main page and (1)(2)(3)] and all based on a single master page. only first page is active, how to keep the list hyperlink active while on page 2, 3. please guide.
Noora MJPosted Nov 15, 2018, 5:12 PM
How can i change the color of active page
Charles McClellanPosted Aug 6, 2018, 10:38 AM
How to make this work with asp:menu and asp:menuitem
Hany KhudairPosted Mar 23, 2018, 5:21 PM
Page1.Attributes.Add("class", "active")
Mohammed HablullahPosted Feb 5, 2018, 9:46 PM
How to write this in switch case
Nabeel ArbabPosted May 4, 2016, 6:36 AM
It giving me below error. Non-invocable member 'HtmlControl.Attributes' cannot be used like a method.
Dipayan (DCPL)Posted Feb 19, 2016, 2:42 AM
It giving me below error. Non-invocable member 'HtmlControl.Attributes' cannot be used like a method.