Programmatically adding LINKs to HTML HEADER in Code Behind

7:15:00 am 0 Comments

In this example I am adding a link to the html header pointing to an rss feed.
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "application/rss+xml");
link.Attributes.Add("rel", "alternate");
link.Attributes.Add("href", Page.ResolveClientUrl("~/rss/LatestArticles/"));
this.Header.Controls.Add(link);

0 comments: