Tech Off Post

Single Post Permalink

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

    JChung2006 said:
    Don't cache ASP.NET control object instances.  Cache the HTML and construct a new HtmlLiteralControl from it, or encapsulate the control into a User Control and use page fragment caching instead.
    That was already suggested over a year ago, the topic has since changed to a request about why HtmlAnchor acts like this.. but yes caching controls isn't suggested, theres potentially a lot of complex interactions with context that can go wrong given that controls can do absolutely anything.. and then theres weird bugs like this..