Click here to Skip to main content
15,891,905 members
Articles / Web Development / HTML

ASP.NET AJAX RSS Reader

Rate me:
Please Sign up or sign in to vote.
3.59/5 (16 votes)
21 Dec 20062 min read 157K   4.1K   65  
An ASP.NET AJAX RSS reader.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="RssToolkit" Namespace="RssToolkit" TagPrefix="rss" %>

<!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>Steve Clements - RSS Reader</title>
    <link href="CSS/Layout.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
    var ele;
    function linklist_onclick(itemNumber) {
        if(ele == null) ele = $get("List1");
        
        ele.className = "";
        ele = ele = $get("list" + itemNumber);
        ele.className = "current";
        return true;
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="content-header">
            <h1><asp:HyperLink ID="HyperLink1" runat="server" Text="Steve's" Target="_blank" NavigateUrl="http://geekswithblogs.net/steveclements"></asp:HyperLink>
                 Blog Role</h1>
        </div>
        <div id="content-container">
            <div id="content-side1">
                <ul class="list-of-links">
                    <li id="list1" class="current">
                        <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument="1" OnCommand="lnkOptions_Command"
                            OnClientClick="linklist_onclick(1);">ASP.NET Latest</asp:LinkButton></li>
                    <li id="list2">
                        <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="2" OnClientClick="linklist_onclick(2);"
                            OnCommand="lnkOptions_Command">C# Latest</asp:LinkButton></li>
                    <li id="list3">
                        <asp:LinkButton ID="LinkButton3" runat="server" CommandArgument="3" OnClientClick="linklist_onclick(3);"
                            OnCommand="lnkOptions_Command">Vista Latest</asp:LinkButton></li>
                    <li id="list4">
                        <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="4" OnClientClick="linklist_onclick(4);"
                            OnCommand="lnkOptions_Command">ASP.net AJAX Latest</asp:LinkButton></li>
                    <li id="list5">
                        <asp:LinkButton ID="LinkButton5" runat="server" CommandArgument="5" OnClientClick="linklist_onclick(5);"
                            OnCommand="lnkOptions_Command">Dmitryr's Latest</asp:LinkButton></li>
                </ul>
            </div>
            
            <div id="content-main">
                <asp:UpdatePanel ID="updateMain" runat="server" UpdateMode="conditional">
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="LinkButton1" />
                        <asp:AsyncPostBackTrigger ControlID="LinkButton2" />
                        <asp:AsyncPostBackTrigger ControlID="LinkButton3" />
                        <asp:AsyncPostBackTrigger ControlID="LinkButton4" />
                        <asp:AsyncPostBackTrigger ControlID="LinkButton5" />
                    </Triggers>
                    <ContentTemplate>
                        <h2>
                            <asp:Label ID="lblHeader" runat="server">ASP.NET Latest</asp:Label></h2>
                        <hr />
                        <asp:Panel ID="BlogPanel1" runat="server">
                            <rss:rssdatasource id="RssDataSource1" runat="server" maxitems="0" Url="http://www.asp.net/News/rss.ashx">
                            </rss:rssdatasource>
                            <asp:DataList ID="BlogList1" runat="server" DataSourceID="RssDataSource1">
                                <ItemTemplate>
                                    <asp:Panel ID="panelHeader" runat="server" Style="cursor: pointer; color: #d61719;
                                        width: 100%; display: block;">
                                        <span style="float: left;">
                                            <%# Eval("title") %>
                                        </span>
                                        <asp:Image ID="Image1" runat="server" Style="float: right;" ImageUrl="~/images/expand_blue.jpg" />
                                    </asp:Panel>
                                    <asp:Panel ID="Panel1" runat="server" 
                                        Style="margin-top: 3px; background: transparent url(images/blogBack.gif) no-repeat text-top left;">
                                        <%# Eval("description") %>
                                        (<asp:HyperLink ID="hlMore" runat="server" NavigateUrl='<%# Eval("link") %>' Target="_blank"
                                            Text="read more"></asp:HyperLink>)
                                    </asp:Panel>
                                    <ajaxt:collapsiblepanelextender id="cpe1" runat="server" targetcontrolid="Panel1"
                                        expandcontrolid="panelHeader" collapsecontrolid="panelHeader" suppresspostback="true"
                                        imagecontrolid="Image1" collapsed="true" expandedimage="~/images/collapse_blue.jpg"
                                        collapsedimage="~/images/expand_blue.jpg" />
                                    <hr style="border-bottom: 1px dotted #B2B2B2; margin: 0px;" />
                                </ItemTemplate>
                            </asp:DataList>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        
        </div>
        <%-- UPDATE PROGRESS PANEL....SHOWS ON BOTTOM LEFT OF SCREEN --%>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="0" DynamicLayout="true">
            <ProgressTemplate>
                <div id="updProgress">
                    <img alt="" src="images/indicator.gif" />
                    <span>Working on your request...</span>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    </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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions