Simple RSS Feed Display

This demo illustrates displaying the RSS <item> elements from a remote RSS feed using a DataGrid. Note that the code to accomplish this is about five lines long! (Also note that the data shown in this demo is a snapshot of the RSS feed's data from Monday, March 17th. A static RSS feed is used to reduce load on the ASPMessagboard.com server.)


titledescriptionlinkpubDatechannel_Id
XhtmlTextWriter Class (System.Web.UI)Writes Extensible Hypertext Markup Language (XHTML)-specific characters, including all variations of XHTML modules that derive from XTHML, to the output stream for an ASP.NET server control for mobil…https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.xhtmltextwriterSun, 20 Jan 2019 02:37:28 GMT0
WebResourceAttribute Class (System.Web.UI)Defines the metadata attribute that enables an embedded resource in an assembly. This class cannot be inherited. https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webresourceattributeSun, 20 Jan 2019 02:37:28 GMT0
WebResourceAttribute.ContentType Property (System.Web.UI) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webresourceattribute.contenttypeSun, 20 Jan 2019 02:37:28 GMT0
WebResourceAttribute.WebResource Property (System.Web.UI) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webresourceattribute.webresourceSun, 20 Jan 2019 02:37:28 GMT0
WebResourceAttribute.PerformSubstitution Property (System.Web.UI) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webresourceattribute.performsubstitutionSun, 20 Jan 2019 02:37:28 GMT0
Xml.Render(HtmlTextWriter) Method (System.Web.UI.WebControls) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.xml.renderSun, 20 Jan 2019 02:37:28 GMT0
Xml.AddParsedSubObject(Object) Method (System.Web.UI.WebControls) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.xml.addparsedsubobjectSun, 20 Jan 2019 02:37:28 GMT0
WebZone Class (System.Web.UI.WebControls.WebParts)Serves as the base class for all controls that act as containers for server controls (including Web Parts controls, server controls, and user controls) in Web Parts applications. https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webzoneSun, 20 Jan 2019 02:37:27 GMT0
WebPartZone Class (System.Web.UI.WebControls.WebParts)Serves as the primary control in the Web Parts control set for hosting controls on a Web page. https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartzoneSun, 20 Jan 2019 02:37:27 GMT0
WebPartZoneBase.OnCreateVerbs(WebPartVerbsEventArgs) Method (System.Web.UI.WebControls.WebParts) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartzonebase.oncreateverbsSun, 20 Jan 2019 02:37:27 GMT0
WebPartZoneBase.HelpVerb Property (System.Web.UI.WebControls.WebParts) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartzonebase.helpverbSun, 20 Jan 2019 02:37:27 GMT0
WebPartVerb.Text Property (System.Web.UI.WebControls.WebParts) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartverb.textSun, 20 Jan 2019 02:37:27 GMT0
WebPartZone Constructor (System.Web.UI.WebControls.WebParts) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartzone.-ctorSun, 20 Jan 2019 02:37:27 GMT0
WebPartZoneBase.CreateVerbs Event (System.Web.UI.WebControls.WebParts)Occurs when the verbs are created for a zone that derives from the class. https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartzonebase.createverbsSun, 20 Jan 2019 02:37:27 GMT0
WebPartVerb.Enabled Property (System.Web.UI.WebControls.WebParts) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartverb.enabledSun, 20 Jan 2019 02:37:27 GMT0
WebPartVerb.ImageUrl Property (System.Web.UI.WebControls.WebParts) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartverb.imageurlSun, 20 Jan 2019 02:37:27 GMT0
WebPartVerb Class (System.Web.UI.WebControls.WebParts)Provides an interactive user interface (UI) element that enables users to perform actions on a Web Parts page. https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartverbSun, 20 Jan 2019 02:37:27 GMT0
WebPartVerb.Description Property (System.Web.UI.WebControls.WebParts) https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartverb.descriptionSun, 20 Jan 2019 02:37:27 GMT0
WebPartTransformer Class (System.Web.UI.WebControls.WebParts)Provides basic implementation for transformer classes to convert data between two incompatible connection points. https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webparttransformerSun, 20 Jan 2019 02:37:27 GMT0
WebPartManager Class (System.Web.UI.WebControls.WebParts)Serves as the central class of the Web Parts control set, managing all the Web Parts controls, functionality, and events that occur on a Web page. https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.webparts.webpartmanagerSun, 20 Jan 2019 02:37:27 GMT0


Source Code
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Data" %>
<script language="VB" runat="server">
  Sub Page_Load(sender as Object, e as EventArgs)
    recentPosts.DataSource = GetRSSFeed("http://www.asp.net/news/rss.ashx")
    recentPosts.DataBind()      
  End Sub


  Function GetRSSFeed(strURL as String) as DataTable
    'Get the XML data
    Dim reader as XmlTextReader = New XmlTextReader(strURL)
    
    'return a new DataSet
    Dim ds as DataSet = New DataSet()
    ds.ReadXml(reader)    
    Return ds.Tables(2)
  End Function
</script>
  
<asp:DataGrid runat="server" id="recentPosts" />

[Return to the article]