Creating an RSS feed

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Creating an RSS feed - Presentation Transcript

    1. RSS Feed using ASP.NET & Linq http://www.livetolearn.in
      • RSS is a format for an XML document that describes a list of items, such as blog entries or news headlines.
      • The document may just be a stream of XML created on the fly rather than a static file.
      http://www.livetolearn.in
      • <rss>
      • <channel>
      • <item>
      • <title></title>
      • <description></description>
      • <link></link>
      • <pubDate></pubDate>
      • <!--..............................-->
      • </item>
      • </channel>
      • </rss>
      http://www.livetolearn.in
      • Add a generic handler named rsshandler.ashx
      • Add import directive Imports System.Xml.Linq
      • Replace the process request() subroutine as follows
      http://www.livetolearn.in
      • Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
      • Dim rssdoc As New XDocument(New XDeclaration( &quot;1.0&quot;, Nothing, Nothing))
      • rssdoc.Add( New XComment( &quot;My RSS Feed uses XML to Linq datasource&quot;))
      • Dim rssrootelement As New XElement( &quot;rss&quot;, New XAttribute( &quot;version&quot;, &quot;2.0&quot;))
      • Dim rsschannel As New XElement( &quot;channel&quot;)
      • Dim rsstitle As New XElement( &quot;title&quot;, &quot;RK's News Channel&quot;)
      • rsschannel.Add(rsstitle)
      • Dim rssdesc As New XElement( &quot;description&quot;, &quot;Description of Channel&quot;)
      • rsschannel.Add(rssdesc)
      • Dim rsslink As New XElement( &quot;link&quot;, &quot;http://www.livetolearn.in/&quot;)
      • rsschannel.Add(rsslink)
      • Dim intCtr As Integer
      • Dim rssitem As XElement
      RSS Document Comment RSS Channel Title (Appears at title bar) RSS Title Link http://www.livetolearn.in
      • For intCtr = 0 To 10
      • rssitem = New XElement( &quot;item&quot;, _
      • New XElement( &quot;title&quot;, &quot;This is item number &quot; & intCtr.ToString), _
      • New XElement( &quot;description&quot;, &quot;Description for item # &quot; & _
      • intCtr.ToString), _
      • New XElement( &quot;link&quot;, &quot;http://www.livetolearn.in/item&quot; & _
      • intCtr.ToString & &quot;.aspx&quot;))
      • rsschannel.Add(rssitem)
      • Next
      • rssrootelement.Add(rsschannel)
      • rssdoc.Add(rssrootelement)
      • rssdoc.Save(( New System.IO.StreamWriter _
      • (context.Response.OutputStream)))
      • End Sub
      This for loop creates 10 sample items with Description. http://www.livetolearn.in
      • Now, browse the rsshandler.ashx with Internet Explorer 7 and above or Firefox
      http://www.livetolearn.in
    2. Displaying XML data http://www.livetolearn.in
      • Add an XmlDataSource control to a ASP.NET page
      • Click smart tag
      • Choose configure data source
      • Enter the URL of the RSS feed
      • For example
      • http://www.livetolearn.in/blog/?feed=rss2
      • Type the following in Xpath expression text box
      • Rss/channel/item
      • Add a data list control and set source to Xmldatasource1,
      • Edit Item template of data list control
      • Add a hyper link control inside the item template
      • Set it’s data binding property as follows Navigate URL – xPath(“link”)
      • xPath(“title”)
      • It displays the list of items from rss feed.
      http://www.livetolearn.in
      • By adding more items in Item Template (e.g. Text box), we can display description from RSS feed.
      • ********
      http://www.livetolearn.in
    SlideShare Zeitgeist 2009

    + Karthi RKarthi R Nominate

    custom

    141 views, 0 favs, 2 embeds more stats

    Creating and displaying RSS feed by using LINQ asp. more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 141
      • 139 on SlideShare
      • 2 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 5
    Most viewed embeds
    • 1 views on http://www.livetolearn.in
    • 1 views on http://livetolearn.in

    more

    All embeds
    • 1 views on http://www.livetolearn.in
    • 1 views on http://livetolearn.in

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Tags