Click here to Skip to main content
13,596,934 members
Click here to Skip to main content
Add your own
alternative version


49 bookmarked
Posted 2 Mar 2006

Creating an RSS Aggregator User Control in ASP.NET

, 2 Mar 2006
Rate this:
Please Sign up or sign in to vote.
This article demonstrates how to easily create an RSS feed aggregator and incorporate it into an ASP.NET application.

Sample Image - screenshot.gif


RSS is an XML format for syndicating news and content, from major news sites, community and personal weblogs. But it's not just for news. It's able to deliver rich, dynamic content to a website, if you know how to read the RSS XML. The RSS Aggregator takes a lot of the mystery out of decoding RSS feeds.


Since the RSS Aggregator is a Web User Control, it's really just about as simple as creating a new application, adding the control and associated code, and dragging and dropping the control on your site. Of course, you will have to setup a couple of small things in the code (like the source of the feeds), but overall, it should be fairly straightforward. The enclosed example even contains a styled version of the aggregator, so you won't have to spend additional time adding styles.

This version allows you to configure the aggregator to download any number of feeds (though personally, I wouldn't do more than three or four, or you'll notice a significant delay on page load). The display medium is an ASP.NET DataGrid control. The example code implements paging for the grid.

Using the code

The code is pretty well documented, so I won't include a ton of code here (not like anyone will read it anyway! :)). The only code block I'll post will be the simple act of configuring the aggregator to download feeds. The rest is up to you!

The only method you need to configure is the BindFeeds() method. This method is located in the RSSAggregator.ascx.cs code-behind. Just follow the directions in the code, and in no time, you'll have a working RSS Aggregator!

private void BindFeeds()
    // Create a new instance of the Aggregator class. This is the
    // only class that an end user will need to instantiate.
    Aggregator ag = new Aggregator(3);

    // Add the feeds we want to display
    ag.feeds[0] = "";
    ag.feeds[1] = "" + 
    ag.feeds[2] = "" + 

    // Create the dataview
    DataView dv = ag.aggregateFeeds();

    // Bind to the datagrid
    this.dgRoller.DataSource = dv;

    // Show the feed sources
    this.lblFeeds.Text = ag.getSources();

Points of Interest

The Downloader class comes with three overloaded methods to allow the aggregator to download through a proxy server. Use the one that's right for you. You can find this code in the aggregateFeeds() method of the Aggregator.cs code page. One last point to note is that there is a boolean value for the parseRSS() method in the Parser class. Setting this value to true will make the aggregator render all of the content of the feed. Setting it to false will render only a description of the content. In the example, this value is set to true.

Happy coding!


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Product Manager iMobile3
United States United States
I have worked professionally in IT since 2004, and as a software architect since 2008, specializing in user interface design and experience, something I am still extremely passionate about. In 2013 I moved into management, and since then I've held positions as Director of Product Development, Director of Engineering, and Practice Director.

You may also be interested in...


Comments and Discussions

GeneralQuery regarding application Pin
abidmehmood18-Sep-07 20:33
memberabidmehmood18-Sep-07 20:33 
GeneralRe: Query regarding application Pin
UsualDosage19-Sep-07 1:22
memberUsualDosage19-Sep-07 1:22 
Generalexcellent tool Pin
lazywill31-Jan-07 8:05
memberlazywill31-Jan-07 8:05 
GeneralException Details: System.ArgumentNullException: Value cannot be null. Pin
dunglesi25-Oct-06 22:03
memberdunglesi25-Oct-06 22:03 
GeneralRe: Exception Details: System.ArgumentNullException: Value cannot be null. Pin
UsualDosage26-Oct-06 3:17
memberUsualDosage26-Oct-06 3:17 
QuestionHow to load the specific content of the web page? Pin
UFOonline5-Sep-06 16:40
memberUFOonline5-Sep-06 16:40 
GeneralCannot run application with a proxy/port Pin
UFOonline16-Aug-06 21:01
memberUFOonline16-Aug-06 21:01 
GeneralRe: Cannot run application with a proxy/port Pin
UsualDosage17-Aug-06 8:34
memberUsualDosage17-Aug-06 8:34 
GeneralRe: Cannot run application with a proxy/port Pin
UFOonline17-Aug-06 17:04
memberUFOonline17-Aug-06 17:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01-2016 | 2.8.180621.3 | Last Updated 2 Mar 2006
Article Copyright 2006 by DreamInHex
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid