O'Reilly logo

Professional ASP.NET 3.5 AJAX by Matt Gibbs, Dan Wahlin, Bill Evjen, Dave Reed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6.2. Sample Application

In this section you look at an application that does not useASP.NET AJAX to see how it behaves with regard to browser history points and some of the problems they cause. Listing 6-1 (AlbumSearch.aspx), included in the sample code for this chapter, along with Listing 6-2 (AlbumSearch.aspx.cs), is a Web page that allows the user to search for a Phish album by name by typing in a search box and clicking the search button. Search results are displayed in a ListView control, and there are buttons for sorting the results by Title or Release Date.

Example 6-1. AlbumSearch.aspx
<%@ Page Language="C#" CodeFile="AlbumSearch.aspx.cs" Inherits="AlbumSearch" %> <!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>Phish Album Search</title> </head> <body> <form id="form1" runat="server"> <asp:TextBox id="txtSearch" runat="server" /> <asp:Button ID="cmdSearch" runat="server" Text="Search" /> <asp:ListView ID="AlbumList" runat="server"> <LayoutTemplate> <p> Sort Order: [<asp:LinkButton ID="SortByTitle" runat="server" CommandName="Sort" CommandArgument="Title" Text="Title" /> | <asp:LinkButton ID="SortByDate" runat="server" CommandName="Sort" CommandArgument="ReleaseDate" Text="Release Date" />] </p> <div id="itemPlaceholder" runat="server"></div> </LayoutTemplate> <ItemTemplate> <div style="font-weight:bold"> <%# Eval("Title") %> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required