Tech Off Post

Single Post Permalink

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

    A work around is to use the HtmlGenericControl instead of the HtmlAnchor.

                        HtmlGenericControl href = new HtmlGenericControl("a");
                        href.Attributes.Add("href", "">");
                        href.Attributes.Add("title", "Word!");
                        href.InnerText = "";

    I'm still interested in determining what causes the href to be removed from the control when cached as a HtmlAnchor.

    We've ruled out an overall problem with the AttributeCollection since the Title attribute is cached properly.  Anyone else have an idea?