I am trying to change the Hyperlink CssClass depending on a filename of current page.
Something like this:
Protected Sub lnkAbout_Load(sender As Object, e As System.EventArgs) Handles lnkAbout.Load
Dim CURL As String = Request.Url.ToString
If Me.lnkAbout.NavigateUrl = CURL Then
Me.lnkAbout.CssClass = "AboutActive"
End If
End Sub
I know this doesn’t work but I would appreciate if someone showed me the right way to do it. Thanks in advance.
You could use
Path.GetFileName+Request.Url.AbsolutePath:(assuming that “About.aspx” is the name of the page you’re looking for)