ListView - Binding to RSS feed

honda world news
rss tuesday, december 12, 2017

 
Tue, 12 Dec 2017 15:00:00 +0900
  New Company to be Established in Spring 2018 http://world.honda.com/shared/img/flag/japan_flag.gif 11 companies including Honda have signed an agreement to form a new company in the spring of 2018, aimed at the full-fledged development of hydrogen recharging stations for fuel cell vehicles in Japan.
 
Mon, 11 Dec 2017 14:00:00 +0900
  Honda Celebrates 60 Years, 5 Million Motorcycles in Malaysia http://world.honda.com/shared/img/flag/malaysia_flag.gif PENANG, Malaysia - Boon Siew Honda Sdn. Bhd., a manufacturer and distributor of Honda's motorcycle in Malaysia, celebrated a historical milestone of 60 years of Honda's motorcycle business in Malaysia, and 5 million units production in Penang.
 
Mon, 11 Dec 2017 10:43:00 +0900
  Honda Updates Super Cub Story Site http://world.honda.com/shared/img/flag/no_flag.gif Honda has added "Vol.5 Export Models: Part 1" to its Super Cub Story site, celebrating the history and charms of one of the world's most iconic scooters.
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.

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • scripts.js
  • styles.css
<%@ Page Language="vb" Inherits="Telerik.ListViewExamplesVBNET.DataBinding.RSSFeed.DefaultVB"CodeFile="DefaultVB.aspx.vb"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Import Namespace="System.Xml" %>
<!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?