Huh right?
I imagine this scenario is pretty common but the solution escapes me. I am using C# and Bootstrap. I have moved my site's navigation into a User Control. I also created a master page which all my front end pages will be spawned from.
On each (child) page, I would like to change the CSS Class of the nav item (<li>) to illustrate to the user which page they are on. I figured I would do this from the page's page_load event.
So, for example, on our 'Services' aspx page, I might do this:
protected void Page_Load(object sender, EventArgs e)
{
ServicesHyperlink.Attributes.Add("CssClass", "active");
}
The User Control, which is dropped in the MasterPage, looks like this:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="FrontEndNav.ascx.cs" Inherits="Controls_FrontEndNav" % ...
Go to the complete details ...