johnson yuan

johnson yuan

  • NA
  • 47
  • 3.1k

How dynamic add css class to navagion bar?

Sep 6 2014 3:21 AM
 if I have this code in a user control file(ascx), I want the page current visited has class "active" 
<ul>   
   <li class="active"><a href="a.html">Home</a></li>
   <li><a href="b.html">About Us</a></li>
</ul>
 
for example: when I visited b.html, the html source should be:
 
<ul>
<li ><a href="a.html">Home</a></li>
<li class="active"><a href="b.html">About Us</a></li>
</ul>

Answers (4)