The Artima Developer Community
Sponsored Link

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

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Damir Tomicic

Posts: 2504
Nickname: damir
Registered: Apr, 2004

Damir Tomicic is Microsoft Regional Director for Germany and INETA Lead
WinDays Samples: Blog Reader in ASP.NET 2.0 [with Screenshots] Posted: May 4, 2004 9:02 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Damir Tomicic.
Original Post: WinDays Samples: Blog Reader in ASP.NET 2.0 [with Screenshots]
Feed Title: Damir Tomicic : community powered
Feed URL: http://tomicic.de/SyndicationService.asmx/GetRss
Feed Description: stuff about .NET, community and life - in several languages.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Damir Tomicic
Latest Posts From Damir Tomicic : community powered

Advertisement

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".
  6. >

    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>

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

Topic: Potential Wi-Fi Legal Woes Previous Topic   Next Topic Topic: Canis Novus

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use