블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Category

Recent Post

Recent Comment

Archive

2009. 10. 15. 12:03 .Net Project/ASP.NET 3.5 Sp1
반응형
 Upload/Search.aspx

 <%@ Page Language="C#" AutoEventWireup="true"
        CodeFile="Search.aspx.cs" Inherits="Upload_Search" %>

<!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>검색</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <asp:GridView ID="ctlUploadList" runat="server"
            AutoGenerateColumns="false" AllowPaging="True"
            PageSize="3" onpageindexchanging="ctlUploadList_PageIndexChanging"
            style="margin-right: 0px">
            <Columns>
                <asp:BoundField DataField="Num" HeaderText="번호" />
                <asp:HyperLinkField DataTextField="Title" HeaderText="제목"
                    DataNavigateUrlFormatString="View.aspx?Num={0}"
                    DataNavigateUrlFields="Num" />
                <asp:TemplateField HeaderText="파일">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server"
                            NavigateUrl=
                            '<%# "Down.aspx?FileName=" + Eval("FileName") %>'>
                            <img src="images/유이.png"
                                    width="50px" height="50px" border="0" alt="다운로드" />
                        </asp:HyperLink>               
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>   
        </asp:GridView>    
        <br />        
        <a href="List.aspx">검색종료</a>
   
    </div>
    </form>
</body>
</html>


 Upload/Search.Cs

using System;

public partial class Upload_Search : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DisplayData();
        }
    }
    protected void ctlUploadList_PageIndexChanging
                                                    (object sender, GridViewPageEventArgs e)
    {
        this.ctlUploadList.PageIndex = e.NewPageIndex;
        DisplayData();
    }

    private void DisplayData()
    {
        UploadBiz ub = new UploadBiz();
        this.ctlUploadList.DataSource = ub.ListUpload();
        this.ctlUploadList.DataBind();
    }
    protected void ctlUploadList_SelectedIndexChanged
                                                                        (object sender, EventArgs e)
    {
        //empty
    }
}






반응형
posted by Magic_kit