1<%...@ Control Language="C#" AutoEventWireup="true"
2 CodeFile="Search.ascx.cs" Inherits="Basic_SearchControl" %>
3<h3>글 검색 결과h3>
4<div>
5<asp:GridView ID="ctlSearchList" runat="server"
6 AutoGenerateColumns="False" AllowPaging="True" PageSize="3"
7 OnPageIndexChanging="ctlSearchList_PageIndexChanging">
8 <Columns>
9 <asp:HyperLinkField
10 HeaderText="제 목"
11 DataTextField="Title"
12 DataNavigateUrlFields="Num"
13 DataNavigateUrlFormatString="View.aspx?Num={0}"
14 />
15 <asp:TemplateField HeaderText="작성자">
16 <ItemTemplate>
17 <%...# DataBinder.Eval(Container.DataItem, "Name") %>
18 ItemTemplate>
19 <AlternatingItemTemplate>
20 <%...# Eval("Name") %>
21 AlternatingItemTemplate>
22 asp:TemplateField>
23 <asp:BoundField HeaderText="작성일" DataField="PostDate"
24 DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" />
25 <asp:BoundField HeaderText="조회수" DataField="ReadCount" />
26 Columns>
27asp:GridView>
28<br />
29<asp:Button ID="btnList" runat="server" Text="검색 종료"
30 OnClick="btnList_Click" />
31div>
32