Click here to Skip to main content
15,880,854 members
Articles / Web Development / ASP.NET

Build a Blog Page Consuming a XML Feed

Rate me:
Please Sign up or sign in to vote.
4.76/5 (9 votes)
2 Nov 2011CPOL 47.6K   596   48  
How to build a blog page using an XML feed
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
      <div>
          &nbsp;
          <asp:GridView ID="GridView1" runat="server" 
           AutoGenerateColumns="False" BorderWidth="1px"
           PageSize="3" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" BackColor="LightGoldenrodYellow" BorderColor="Tan" CellPadding="2" ForeColor="Black" GridLines="None">
     <Columns>
       <asp:TemplateField>
         <ItemTemplate>
          <h3><%# Eval("title") %></h3> author: <%# Eval("author") %>
          <hr />
          <%# Eval("pubDate")%><br />
          <%# Eval("description")%>
          <a href="<%# Eval("link")%>">(more)</a><br /><br />
         </ItemTemplate>
       </asp:TemplateField>
     </Columns>
              <FooterStyle BackColor="Tan" />
              <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
              <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
              <HeaderStyle BackColor="Tan" Font-Bold="True" />
              <AlternatingRowStyle BackColor="PaleGoldenrod" />
   </asp:GridView>
      </div>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Italy Italy
Check the my Blog

Comments and Discussions