I just ran into a strange problem where all the links on a list are getting dropped. The anchor tag was still there but the href was gone. I tracked it down to a bug in the cache.
Here is the scenario.
I am building a fairly complex bullet list in code that will change very infrequently so I cache the user control for 24 hours. The problem is anything being built with an HtmlAnchor control is losing the Href value, but not anything else.
This breaks:
var anchor = new HtmlAnchor { HRef = "http://www.juggle.com/", InnerText = "Juggle" };
This works:
var anchor = new HtmlGenericControl("a") { InnerText = "Juggle" };
anchor.Attributes.Add("href", "http://www.juggle.com/");
Now if I try to re-create the bug with a simple test, no luck. It is some other deadly combination. Maybe caching the entire UserControl?
Anyone else seen this bug?
This was the only thing I could find about it.
Problem with HTMLAnchor and ASP.Net Cache
Technorati Tags:
asp.net,
cache