In my master page I have a top-level menu that is created using ActionLinks:
<ul id="topNav">
<li><%=Html.ActionLink("Home", "Index", "Home")%></li>
<li><%=Html.ActionLink("News", "Index", "News")%></li>
<li><%=Html.ActionLink("Projects", "Index", "Projects")%></li>
<li><%=Html.ActionLink("About", "About", "Home")%></li>
<li><%=Html.ActionLink("Contact", "Contact", "Home")%></li>
<li><%=Html.ActionLink("Photos", "Photos", "Photos")%></li>
</ul>
I want to dynamically add a class named "current" to the link that the site is currently pointing to. So, for example, when the site is sitting at the home page, the menu link would render like this:
<li><a class="current" href="/">Home</a></li>
Do I have to overload the ActionLink method to do this, or create an entirely new HtmlHelper, or is there a better way?
I'm fairly new to MVC, so I'm not sure what is the correct way to go about this.
Thanks in advance.