I was working on an ASP.NET site that wasn’t Community Server yesterday (yeah, wild eh?), and was asked to change the colors of a potentially lengthy list of document links so that users could click on a link, view a document, then return to the list and readily determine which document links they had previously viewed.
Easy, A:Visited, but here was the catch. It could only be for that session. The list links had to appear virginal on the next visit.
Okay, how about turning off Response Cache.
That didn’t work on my client’s server. I need to check into that when I can. It worked on my office network, but not where we needed it to work.
Then I went into hack mode and thought “unique links…unique session.” The A:Visited style settings are applied to unique hyperlink addresses. Add a SessionID to the url!
<span class=”doclink”><a href='<%# DataBinder.Eval(Container.DataItem,”fileurl”) +
“?s=” + HttpContext.Current.Session.SessionID %>’
My client told me people stopped by his office afterward saying “thank you, thank you, thank you!” for the functionality added by that simple hack.