Programmatically adding LINKs to HTML HEADER in Code Behind

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);

Please do not post any spam link in the comment box😊

Post a Comment (0)
Previous Post Next Post