This user control displays one or more RSS channels in an HTML table. It also includes a method (not used in the example) to download the content of the channel for later use. The difference between this control and other controls or services like rss-info is that the appearance of the control can be configured with the same CSS styles used in the rest of your application.
Using the Code
Include the user control in your app and add it to the desired page.
The control has these properties:
|Name of the CSS style to apply to the table which contains all the feeds.|
|Name of the CSS style to apply to the name of the RSS channel.|
|Name of the CSS style to apply to the link associated with the current news.|
|Name of the CSS style to apply to the cell which contains the news title.|
|Name of the CSS style to apply to the cell which contains the text of the news.|
|If this flag is |
true, the content of the news will be displayed; otherwise, only the title and link will be displayed. The default value is
|Width of the table which contains all the feeds (pixels); if it is not specified, the default value is 100.|
|String array which contains all the RSS channel URLs to show.|
|Number of news to show per channel; if it is not specified, the control will display all the news.|
|If the flag is |
true, the content of the news will be displayed as HTML; otherwise, it will be displayed in text format. The default format is text.
And a method:
|This function returns all the data returned to the browser by a URL. This can be an HTML page or whatever; you can use this string to save the content to a file.|
string  channels= new string;
channels = "http://rssfeeds.usatoday.com/usatoday-HorseRacing";
channels = "http://www.horse-races.net/HRN-rssfeed.xml";
channels = "http://news.google.com.mx/nwshp?client=firefox-a&rls" +
Rssfeed1.urls = channels;
Rssfeed1.width = 150;
Rssfeed1.showContent = true;
Rssfeed1.showContentInHtml = true;
Rssfeed1.ChannelCss = "GrayBackgroundActive";
Rssfeed1.ContentCss = "NormalLetter";
Rssfeed1.LinkCss = "projectletter";
Rssfeed1.newsNumber = 3;
Points of Interest
The control uses a dataset to populate the table, and that dataset is filled directly from the RSS channel with the method
ReadXml(), but some channels throw an error because the item "link" is repeated in the same node; when this happens, you will see an error.
In this case, you could use the method
DownloadFeed of the control to download the content of the channel and parse it as you wish. But the control works fine with most RSS channels; in the sample code, the Google News channel and two othres are used.