1: <%@ Register TagPrefix="uc1" TagName="SearchControl" Src="SearchControl.ascx" %>
2: <%@ Register TagPrefix="uc1" TagName="EasySearchResults_DataGrid" Src="EasySearchResults_DataGrid.ascx" %>
3: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
4: <HTML>
5: <HEAD>
6: <title>EasySearch Sample 2 :: Paged DataGrid Results</title>
7: <link rel="stylesheet" href="easysearch.css" type="text/css">
8: </HEAD>
9: <body marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0"
10: bgcolor="#ffffff">
11: <form runat="server" ID="SearchForm">
12: <P>Sample 2 :: This EasySearch sample is identical to sample 1, with the added benefit
13: of paging our search results.</P>
14: <P>
15: <uc1:SearchControl
16: id="SearchControl"
17: ResultsPageUrl="~/EasySearch/Sample2.aspx?Search={0}"
18: IncludeEnterPostBack="true"
19: runat="server" /></P>
20: <P>Notice the </P>
21: <h1>Results</h1>
22: <uc1:EasySearchResults_DataGrid
23: id="EasySearchResults_DataGrid1"
24: ItemsPerPage="3"
25: runat="server" />
26: </form>
27: </body>
28: </HTML>
Sample 2 builds on Sample 1, by simply adding an ItemsPerPage="3" property to the EasySearchResults_DataGrid. 3 is probably too small of a number of items per page for a production environment, but we wanted to make sure you see the paging results, in case your search term only brings back a few results. The magic to paging results all hinges on line 24. That's all there is to it, the results control automatically knows how to handle paging.