A
Al Cadalzo
I want to programmatically make a asp:hyperlink appear as if it's been
visited. I experimented with setting it's enabled property to false, but I
wasn't satisfied with the appearance, so I tried this approach:
Dim cntrl As Control
Dim hlink As HyperLink
cntrl = FindControl(lnkID)
If Not cntrl Is Nothing Then
hlink = DirectCast(cntrl, HyperLink)
hlink.NavigateUrl = String.Empty
hlink.ForeColor = Color.Black
End If
The ForeColor does change to black, but I've tried setting hlink.Underline =
False but that didn't work, it still appears underlined, so I thought maybe
I would take a different approach and try making it's state 'Visited' so
that it would pick up the style for a 'visited' link from the stylesheet.
Does anyone know how to do that?
Thanks,
Al
visited. I experimented with setting it's enabled property to false, but I
wasn't satisfied with the appearance, so I tried this approach:
Dim cntrl As Control
Dim hlink As HyperLink
cntrl = FindControl(lnkID)
If Not cntrl Is Nothing Then
hlink = DirectCast(cntrl, HyperLink)
hlink.NavigateUrl = String.Empty
hlink.ForeColor = Color.Black
End If
The ForeColor does change to black, but I've tried setting hlink.Underline =
False but that didn't work, it still appears underlined, so I thought maybe
I would take a different approach and try making it's state 'Visited' so
that it would pick up the style for a 'visited' link from the stylesheet.
Does anyone know how to do that?
Thanks,
Al