Tech Off Post

Single Post Permalink

View Thread: Problem with HTMLAnchor and ASP.Net Cache
  • User profile image

    Re: don't cache ASP.NET controls, it bears repeating.  Here's another example of why you shouldn't cache ASP.NET control instances or store them in session state - ASP.NET Memory Issues: High Memory Usage with AjaxPro [].

    The HtmlAnchor class can resolve virtual paths if you use the HRef property but can't if you set the attribute via the Attributes collection, I think. Definitely, it has screwy behavior, particularly if you're trying to use named anchors, e.g., <a href="#foo">Go to foo</a> and <a id="foo">Here's foo</a>. ASP.NET overriding the id attribute for its own purposes particularly sucks for this HtmlAnchor use case and is one of many reasons I am getting sick of WebForms. I love the low-level ASP.NET/IIS platform, but I'm looking forward to booting WebForms as soon as ASP.NET MVC is golden.