Dynamic data pages: exposing your data through RSS feeds

Published Mon, May 21 2007 22:49

The DynamicRssLink control generates a link that you can put in your page and that is responsible for initiating the automatic generation of an RSS feed that you may consume on your blog reader. By default, the control generates an Hyperlink control. Following the same principles explained here, you can customize its appearance (or event create a new Hyperlink control and associate it with the DynamicRssControl).

When you drop a DynamicRssLink control on a page, you'll want to override the GetRssFields method that your page inherits from the DynamicDataPage base class. You're supposed to return (at most) 2 column names that you want to show in your RSS feed. Again, you can follow the approaches presented here. The following example overrides this method and returns a simple column and a dynamic column (again, for the Students table):

public override IEnumerable GetRssFields ()
{
   return new object[] { 
      "StudentID",
       new DynamicDataColumn( "Complete info",
                                                 delegate{ 
                                                      return string.Concat( EvalS( "Name" ), " - ", EvalS( "Address" ) );
                                                   } )
   };
}

If you subscribe the feed, do note that clicking on an item will send you back to the details view page of that table (which takes into account these aspects).

Filed under:

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above:  

Search

This Blog

Tags

Community

Archives

Syndication

Email Notifications

News




  • View Luis Abreu's profile on LinkedIn


    Follow me at Twitter

    My books

    Silverlight 4.0: Curso Completo

    ASP.NET 4.0: Curso Completo

    Portuguese LINQ book cover

    Portuguese ASP.NET 3.5 book cover

    Portuguese ASP.NET AJAX book cover

    Portuguese ASP.NET AJAX book cover