Hi Experts,
I am using masterpages with a menu set up via hyperlinks as listitems.
I am trying to reference the hyperlinks to appy the "current" CSS Class. I cannot find the link. I am using the following in page load but I cannot 'find' the control.
Dim mpHyperLinkHome As HyperLink = CType(Master.FindControl("HyperLinkHomeMaster"), HyperLink)
If mpHyperLinkHome Is Nothing Then
Response.Write("no find the link")
Else
mpHyperLinkHome.CssClass = "current"
End If
..... in Masterpage
<nav>
<ul class="sf-menu">
<li>
<asp:HyperLink ID="HyperLinkHomeMaster" runat="server" NavigateUrl="~/Default.aspx">Home</asp:HyperLink></li>
<li><a href="index-1.html">Services</a>
<ul>
<li><a href="#">Production practice</a></li>
<li><a href="#">Genetic engineering</a></li>
<li><a href="#">Costs and benefits</a>
<ul>
<li><a href="#">Procesing</a></li>
<li><a href="#">Distribution</a></li>
<li><a href="#">Marketing</a></li>
</ul>
</li>
<li class="last"><a href="#">Economics and agriculture</a></li>
</ul>
</li>
<li><a href="products.aspx">Products</a></li>
<li><a href="index-3.html">Technology</a></li>
<li><a href="index-4.html">Contact Us</a></li>
</ul>
</nav>
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.