ASP.Net: Adding feed auto-discovery & meta tags to the page header

Published Fri, Sep 21 2007 1:27 AM | David V

Every now and then, I will post code snippets which others might find useful.  Here is one:

How to add an RSS auto-discovery meta tag to the page header:

 Private Sub AddRSSLink(ByVal title As String, ByVal URL As String)
Dim link As New HtmlLink
link.Attributes.Add("type", "application/rss+xml")
link.Attributes.Add("rel", "alternate")
link.Attributes.Add("title", title)
link.Attributes.Add("href", URL)
End Sub

What about meta tags?

Dim hm As New HtmlMeta()
hm.Name = "Description" ' Or Keywords
hm.Content = "Description..."

Why not just put this in the .aspx you ask? Check out the tags on this page for the answer.


Filed under: , ,