I have a navigation menu as an ASP.NET web-forms user control (ASCX).
Each menu item can become active depending on the page the control is rendered at. The active state should be denoted with an additional CSS class named "active".
What item to become active is controlled from the code-behind file by setting to true one of these properties: IsMenuItem1Active or IsMenuItem2Active.
Now my question is: How, based on the set property, can I modify the CssClass property of the corresponding menu item inside the view without doing any additional logic in code-behind?
<div class="menu">
<asp:HyperLink runat="server" ID="MenuItem1" CssClass="menu-item" NavigateUrl="~/">Menu item 1</asp:HyperLink>
<asp:HyperLink runat="server" ID="MenuItem2" CssClass="menu-item" NavigateUrl="~/">Menu item 1</asp:HyperLink>
</div>