Northstar Research Partners

Subscribe to this Blog

 

Contact Us!

 
AppTheory wants to talk to you about your business requirements.

Click Contact to fill out an online requirements questionnaire.

Thanks!

 

DotNetNuke Blogs

 

Current Articles | Archives | Search

Consume A Rss Feed

DotNetNuke provides the News Feeds module out of the box to consume Rss. It will also allow you to style the display of the feed via XSLT. This is a great starting point for Rss feed consumption, but sometimes the may not allow you granular enough control of the consumption. Furthermore,at times you may want to embed this functionality within your module. There are already quite a few libraries out there such as RSS.NET and the RSS Toolkit that can handle this functionality for you, and if you have no restrictions that prohibit their use then by all means do not reinvent the wheel. However, sometimes you may not be able to bundle third party libraries with your module due to client restrictions, licensing restrictions, or any number of other reasons. In this scenario its always nice to be able to handle this functionality on your own. Below is a quick and dirty way to achieve just that using the XmlDataSource as the data source of  a databound control.

<asp:DataList ID="FeedList" runat="server" DataSourceID="RSSFeedDataSource">
 <ItemTemplate>
 <h4>
 <a href='<%# XPath("link") %>'>
 <asp:Label runat="server" ID="TitleLabel" Text='<%# XPath("title") %>'></asp:Label>
 </a>
 </h4>
 <p>
 Published On: <asp:Label runat="server" ID="PubDateLabel" Text='<%# XPath("pubDate") %>'></asp:Label>
 </p>
 <p>
 <asp:Label runat="server" ID="DescriptionLabel" Text='<%# XPath("description") %>'></asp:Label>
 </p>
 <p>
 <a href='<%# XPath("link") %>'>Read More</a>
 </p>
 <br />
 </ItemTemplate>
</asp:DataList>
<asp:XmlDataSource ID="RSSFeedDataSource" runat="server" DataFile="http://feeds.apptheory.com/Apptheory_DotNetNuke_Blog"
 XPath="/rss/channel/item"></asp:XmlDataSource>

Posted in: General on Monday, November 17, 2008 5:02 PM by Scott Schecter

COMMENTS

Name (required)

Email (required)

Website

Enter the code shown above:

Privacy Statement | Terms Of Use
Copyright © 2008 AppTheory
Trend Influence TrendCRM AppTheory