ListView - Binding to RSS feed

honda world news
rss friday, december 02, 2016

 
Thu, 1 Dec 2016 17:02:00 +0900
  Honda Opens European Endurance Racing History Site http://world.honda.com/shared/img/flag/no_flag.gif Honda has added to its EWC site "European Endurance Racing: The History of Invincible Honda," a weekly documentary exploring Honda's history and achievements in endurance racing.
 
Mon, 28 Nov 2016 10:50:00 +0900
  Honda Releases "The Dakar Rally Revealed" Video http://world.honda.com/shared/img/flag/no_flag.gif Honda has released on its Dakar Rally site the video "The Dakar Rally Revealed," providing a overview of competing in the world's toughest motor race.
 
Sat, 26 Nov 2016 11:28:00 +0900
  Honda Ends WTCC Season with Qatar Podium http://world.honda.com/shared/img/flag/qatar_flag.gif Losail, Qatar - Honda finished the 2016 FIA World Touring Car Championship with a hard-fought podium finish by Rob Huff's third place in the opening race of the final round of the season, the Race of Qatar.
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?