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 1 :: 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 1 :: This EasySearch sample contains the use of two user controls. The
13: first SearchControl, is responsible for rendering a Textbox, that allows the
14: end user to type in the content they would like to search for.</P>
15: <P>
16:
17: <uc1:SearchControl
18: id="SearchControl"
19: ResultsPageUrl="~/EasySearch/Sample1.aspx?Search={0}"
20: IncludeEnterPostBack="true"
21: runat="server" />
22:
23: </P>
24: <P>The Second control is the EasySearchResults_DataGrid control. EasySearch Results
25: are returned in a datatable, so it's easy to bind the results against a number
26: of controls, which we'll see in the next few examples.</P>
27: <h1>Results<h1>
28:
29: <uc1:EasySearchResults_DataGrid
30: id="EasySearchResults_DataGrid1"
31: runat="server" />
32:
33: </form>
34: </body>
35: </HTML>
The above example is the HTML code view of EasySearch\Sample1.aspx. This is a very basic sample, simply showing two User Controls in use.
- SearchControl (Lines 17-21)
- EasySearchResults_Datagrid (Lines 30-31)
Remember when you're moving these controls into your own pages, that they need to be registered, with the <%@ Register %> at the top of your ASPX page. Also remember that the @Register directive needs a path back to the User Controls. Here the path is relative because the Sample1.aspx is in the same directory as the ASCX user control files. However, if you copy lines 17-21 into a new ASPX page in your root folder, you would also have to copy line 1 and change the source tag to "/EasySearch/SearchControl.ascx".