Scott Kuhl

Warning: I may have no idea what I am talking about!
posts - 765, comments - 862, trackbacks - 350

My Links

News


Help CMTA!

Twitter







Tag Cloud

Archives

Post Categories

Image Galleries

ASP.NET Cache and HtmlAnchor HRef Bug

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: ,

Print | posted on Thursday, September 04, 2008 2:28 PM |

Feedback

Gravatar

# re: ASP.NET Cache and HtmlAnchor HRef Bug

I have almost same problem.. I am using fragment caching and the HtmlAnchors inside a repeater are some times rendering proper urls based on my code and some times rendering relative urls based on the current page.. dont know why.. its weired any solution...
8/7/2009 1:58 AM | Anz
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: