Showing 3rd Party RSS Feeds

Showing 3rd Party RSS Feeds

May 21, 2009 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

**Sample Code is Available Here**




You can show RSS Feeds from 3rd party websites because RSS Feed data is in XML, so you just need to load it into a dataset, select a table from it, and bind it to a data-bound control. This article will discuss this process.




The sample code is available for this project above. Please copy and paste the code into your project. In the Web.config, paste this code in between the <toolboxControls> tags:


<add name="RadGridXMLFeed" section="Integration" url="~/UserControls/Integration/RadGridXMLFeed.ascx" 
         description="RadGrid XML Feed" /> 


For more info on uploading controls, please read this article.

End Result

Once the control is dragged and dropped onto a page, here is the end result (using today's RSS Feed):



How it Works

When you click edit on the control, a dialog with a text box appeared. I used a control designer for this feature and for more info on creating these designers, please read this blog post

I created a method for taking in an RSS Feed location, feeding the XML data into a data set and selecting a table to bind a RadGrid. Here is the code:


using System; 
using System.Data; 
using Telerik.Web.UI; 
public partial class RadGridXMLFeed : CustomControlBase 
    protected void Page_Load(object sender, EventArgs e) 
        RadGrid1.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource); 
    void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        //Make sure an RSS Feed has been specified before binding the data 
        if (!String.IsNullOrEmpty(MyNewsFeed)) 
            BindGrid(MyNewsFeed, 3, RadGrid1); 
            ErrorLabel.Text = "Please specify an RSS Feed for this control."
    /// <summary> 
    /// Binds grid to XML data source of rss feed 
    /// </summary> 
    /// <param name="strRss"></param> 
    /// <param name="iTable"></param> 
    /// <param name="RadGrid1"></param> 
    public void BindGrid(string strRss, int iTable, RadGrid RadGrid1) 
            //Make sure an RSS Feed has been specified before binding the data 
            if (!String.IsNullOrEmpty(strRss)) 
                DataSet Ods = new DataSet(); 
                RadGrid1.DataSource = Ods.Tables[iTable]; 
        catch(Exception ex) 
            ErrorLabel.Text = "I am sorry, but that RSS Feed won't work with this control. Please try another one.";  

To get an RSS feed from Thomson Reuters, follow these steps:


  1. Go to this URL:
  2. Right click on an RSS Feed
  3. Select Copy Link location
  4. Copy and paste the link into the control designer as shown below:
control desginer


The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments are disabled in preview mode.
Latest Stories in
Your Inbox
More From Progress
The New Mobile Development Landscape
Download Whitepaper
IDC Spotlight Sitefinity Thumbnail
Choosing the Right Digital Experience Platform to Improve Business Outcomes
Download Whitepaper
The Fastest Way to Build Mobile Apps With Cloud Data
Watch Webinar