I’m not sure if this is at all possible (there may be a different way to acheive it) but is there a way to iterate though all hyperlinks on Page_PreRender and if the NavigateUrl matches the file name then I can add a class to the link to show this as the active page.
Or even better, iterate through all hyperlink NavigateUrls within a certain DIV.
I can do it individually but that would take too long as there are so many links and be too hard to manage:
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
Dim filePath As String = System.Web.HttpContext.Current.Request.Path
If filePath = "/" & hMembership.NavigateUrl Then
hMembership.CssClass = "active"
End If
End Sub
You can do something like this in the Page_PreRender: