RSS 2.0 FEED

Xing
Facebook
Twitter
LinkedIn
Plaxo




COMMUNITIES
Community Engagement

TOOLS

Kostenfreies AxCMS.net - Enterprise Content Management System

Categories

On this page

WinDays Samples: Blog Reader in ASP.NET 2.0 [with Screenshots]

Archive

Navigation

Total Posts: 1497
This Year: 54
This Month: 0
This Week: 0
Comments: 1897

Sign In

 Tuesday, May 04, 2004
Tuesday, May 04, 2004 4:46:14 PM (W. Europe Standard Time, UTC+01:00)

You have heard about it, but you couldn't believe it? It's true ... here is one sample, which demostrates how easy is to build a simple RSS Blog Reader from scratch using the new asp:XmlDatasource control, the asp:GridView server control and new XPath binding support for hierarchical data structures.

How to create simple RSS Blog Reader?

  1. Start Visual Studio 2005 (aka "Whidbey")
  2. Click on "File", than "New", than "Web Site", than create "Empty Web Site" somewhere on your disk
  3. Click on "File", than "New", than "File" and create new WebForm BlogReader.aspx with option "Place Code in separate file" checked.
  4. Take the code and put it in your page within <form>-tag.
  5. Click on BlogReader.aspx with right mouse and choose "View in Browser".

Voilà ;-)

Here are the Screenshots:

You can put the same functionality in Web User Control / Web Part, and add any avaliable RSS-Feed to your web site. ;-)

Code:

    <div>
        <asp:XmlDataSource ID="XmlDataSource1" DataFile="
http://tomicic.de/SyndicationService.asmx/GetRss"
            XPath="rss/channel/item" Runat="server" /><%#XPath("pubDate")%>
        <%#XPath("title") %>
        <%# XPath("description") %>
        &nbsp;
    </div>
        <br />
        <asp:GridView ID="GridView1" Runat="server" BorderColor="#CCCCCC" BackColor="White"
            BorderWidth="1px" BorderStyle="None" CellPadding="6" CellSpacing="6" DataSourceID="XmlDataSource1"
            AllowPaging="True" PageSize="5" AutoGenerateColumns="False">
            <FooterStyle ForeColor="#000066" BackColor="White">
            </FooterStyle>
            <PagerStyle BackColor="White" HorizontalAlign="Left" ForeColor="#000066">
            </PagerStyle>
            <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#006699">
            </HeaderStyle>
            <Columns>
                <asp:TemplateField HeaderText="Damir Tomicic">
                    <ItemStyle ForeColor="#000066">
                    </ItemStyle>
                    <ItemTemplate>
                        <%#XPath("pubDate")%>
                        <br />
                        <b>
                            <a href="
<%#XPath("link") %>">
                            <%#XPath("title") %></a> [<%#XPath("category") %>]
                        </b>     
                        <br />

                        <%# XPath("description") %> 
                        <a href="<%#XPath("link") %>">[Read more ...]</a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <SelectedRowStyle ForeColor="White" Font-Bold="True" BackColor="#669999">
            </SelectedRowStyle>
            <RowStyle ForeColor="#000066">
            </RowStyle>
        </asp:GridView>

ASP.NET | Development   #  RSS 2.0   |  



Related posts:
.NET Day Franken 2010
Interactive STERN.DE Image Gallery
Introducing IIS Express
Fotos fürs Leben mit AxCMS.net
Help & Support Center for AxCMS.net
Keynote beim .NET Day Franken

Referred by:
http://weblogs.asp.net/aspnet-de-blogs/archive/tags/ASP.NET_... [Referral]
march (search.live.com) [Referral]
april (search.live.com) [Referral]
http://weblogs.asp.net/aspnet-de-blogs/archive/2004/05.aspx [Referral]
april (search.live.com) [Referral]
blog screenshots (images.search.yahoo.com) [Referral]
visual studio screenshots (images.search.yahoo.com) [Referral]
september (search.live.com) [Referral]
october (search.live.com) [Referral]
visual studio 2005 (search.live.com) [Referral]
microsoft visual studio 2005 (search.live.com) [Referral]
december (search.live.com) [Referral]
visual studio 2005 (search.prodigy.msn.com) [Referral]
damir tomicic (delicious.com) [Referral]
visual studios 2005 (search.live.com) [Referral]
blogs screenshots (search.live.com) [Referral]
february (search.live.com) [Referral]
april (search.live.com) [Referral]
http://blog.ice-lingen.de/default.aspx [Referral]
http://indepthtalk.net/Directory/Bloggers/Damir_Tomicic/2112... [Referral]
visual studio 2005 filterui:imagesize-large (www.bing.com) [Referral]
ASP.NET Gridview mit Foto (www.bing.com) [Referral]
create empty axcms site (www.google.com) [Referral]
damir (www.bing.com) [Referral]
PagerStyle like bing (www.google.com.au) [Referral]
picture of Microsoft Content Control (www.bing.com) [Referral]
Damir Tomicic blog (www.google.com) [Referral]