ListView - Binding to RSS feed

honda world news
rss monday, september 26, 2016

 
Mon, 26 Sep 2016 16:25:00 +0900
  Honda Philippines Marks 5 Million Unit Milestone http://world.honda.com/shared/img/flag/philippines_flag.gif BATANGAS, Philippines - Honda Philippines, Inc., a manufacturer and distributor of Honda motorcycles in the Philippines, celebrated its milestone of the 5 millionth Honda motorcycle manufactured in the country.
 
Mon, 26 Sep 2016 11:35:00 +0900
  Honda Marine Debuts New 4-stroke Engines http://world.honda.com/shared/img/flag/usa_flag.gif ALPHARETTA, GA, USA, - Honda Marine announced the debut of the all-new BF4 and BF6 4-stroke outboards in addition to the redesigned, legendary BF5 model.
 
Mon, 26 Sep 2016 11:10:00 +0900
  MotoGP Track Report Round 14 http://world.honda.com/shared/img/flag/no_flag.gif Honda has added the MotoGP Track Report featuring analyses by Livio Suppo, HRC Team Principal, for Round 14, the Aragon Grand Prix.
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

This demo shows how to bind RadListView to XML RSS feed server-side.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • scripts.js
  • styles.css
<%@ Page Language="c#" Inherits="Telerik.ListViewExamplesCSharp.DataBinding.RSSFeed.DefaultCS"CodeFile="DefaultCS.aspx.cs"  %>

<%@ Import Namespace="System.Xml" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <script type="text/javascript" src="scripts.js">
    </script>
    <div class="demo-container size-wide">
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadListView ID="RadListView1" runat="server" RenderMode="Lightweight" OnNeedDataSource="RadListView1_NeedDataSource"
                AllowPaging="true" ItemPlaceholderID="Panel1" PageSize="3">
                <LayoutTemplate>
                    <div class="layoutWrapper">
                        <div class="rssHeaderWrapper" title="Copyright, 2011 Honda Motor Co., Ltd. and its subsidiaries and affiliates. All Rights Reserved.">
                            <div class="rssSubHeader">
                                honda world news
                            </div>
                            <div class="rssHeader">
                                rss <span class="rssHeadingDate">
                                    <%# DateTime.Now.ToLongDateString().ToLower() %></span>
                            </div>
                        </div>
                        <br />
                        <table class="rssTable">
                            <asp:Panel ID="Panel1" runat="server"></asp:Panel>
                        </table>

                        <div class="imageWrapper">
                            <asp:ImageButton ID="PrevBtn" runat="server" CommandName="Page" CommandArgument="Prev"
                                AlternateText="<" CssClass="rssButtons" ImageUrl="images/iconPrev.png"></asp:ImageButton>
                            <asp:ImageButton ID="RefreshBtn" runat="server" CommandName="Rebind" AlternateText="Refresh"
                                CssClass="rssButtons" ImageUrl="images/iconRefresh.png"></asp:ImageButton>
                            <asp:ImageButton ID="NextBtn" runat="server" CommandName="Page" CommandArgument="Next"
                                AlternateText=">" CssClass="rssButtons" ImageUrl="images/iconNext.png"></asp:ImageButton>
                        </div>
                    </div>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td>&nbsp;
                        </td>
                        <td colspan="2">
                            <div class="rssTitle">
                                <img src="images/iconRSS.png" alt="rss" />
                                <a href='<%# GetXmlContent(Container, "link") %>' class="qsfSubtitle">
                                    <%# GetXmlContent(Container, "title") %>
                                </a>
                            </div>
                            <div class="rssDate">
                                <%# GetXmlContent(Container, "pubDate")%>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;
                        </td>
                        <td>
                            <img src='<%# GetXmlContent(Container, "hww:photo") %>' class="qsfPhoto"
                                alt='<%# GetXmlContent(Container, "title") %>' />
                        </td>
                        <td>
                            <img src='<%# GetXmlContent(Container, "hww:flag") %>' alt='<%# GetXmlContent(Container, "hww:flag") %>' />
                            <span class="rssDescription">
                                <%# GetXmlContent(Container, "description")%></span>
                        </td>
                    </tr>
                </ItemTemplate>
            </telerik:RadListView>
        </telerik:RadAjaxPanel>
        <asp:Label ID="lblMessage" Visible="false" CssClass="message" runat="server" />
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Black" OnClientShowing="loadingPanelShowing">
        </telerik:RadAjaxLoadingPanel>
    </div>
    </form>
</body>
</html>

Find Assistance

Help Us Improve

Was this example helpful?