Friday 26 November 2010

Databound google sitemaps with repeaters in

I thought I'd put out another use for the xml databinding as described in the earlier post on RSS feeds.

The basic principle can be used for anything, but one use we've put it to on the Pre-Sales Advisor site is to generate a databound xml sitemap for google submission (for full details of the format see the official site at

In most data driven websites the data pages you really want found are displayed by calling a standard page with the correct querystring (e.g. for Bladecenter HS22, for system x3630 M3s). As long as you can pull out a list of valid identities through a datasource then all you need to do is set up your repeater templates as follows:

 <urlset xmlns=""


      <loc><%# Server.HtmlEncode(String.Format("{0}", DataBinder.Eval(Container.DataItem, "IDENTITYCOLUMN")))%></loc>

and there you have it. For an example of what it comes out like have a look at the xml site map linked from (incidentally, if you have a look at the global part map that uses basically. the same data sources and repeater setup).

No comments:

Post a Comment