1using System;
2using System.Web.UI;
3using System.Web.UI.WebControls;
4using Microsoft.Practices.EnterpriseLibrary.Data;
5
6public partial class Upload_SearchControl : System.Web.UI.UserControl
7...{
8 protected void Page_Load(object sender, EventArgs e) ...{
9 if (!Page.IsPostBack) // 처음 로드시에만 출력
10 ...{
11 DisplayData();
12 }
13 }
14 private void DisplayData() ...{
15 ctlUploadList.DataSource =
16 DatabaseFactory.CreateDatabase("ConnectionString").
17 ExecuteDataSet("SearchUpload",
18 Request["SearchField"],
19 Request["SearchQuery"]);
20 ctlUploadList.DataBind();
21 }
22 protected void btnList_Click(object sender, EventArgs e) ...{
23 Response.Redirect("List.aspx");
24 }
25 protected void ctlUploadList_PageIndexChanging(
26 object sender, GridViewPageEventArgs e) ...{
27 ctlUploadList.PageIndex = e.NewPageIndex; // 동일
28 DisplayData(); // 변경된 페이지에 해당하는 데이터 출력
29 }
30}
31