Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            BookBL bookBL     = new BookBL();
            string activePage = Request.QueryString["page"] == null ? "1" : Request.QueryString["page"];

            int dataCount = Convert.ToInt32(bookBL.bookListCount(Request.QueryString["type"], Request.QueryString["class_id"], Request.QueryString["list"]));

            //實作分頁
            bookBL.Pages(Panel1, activePage, dataCount, Request.QueryString["type"], Request.QueryString["class_id"], Request.QueryString["list"]);
            //資料綁定
            DataList1.DataSource = bookBL.bookList(Request.QueryString["type"], Request.QueryString["class_id"], Request.QueryString["list"], Convert.ToInt32(activePage));
            DataList1.DataBind();
        }
        catch (Exception ex)
        {
            ex.ToString();
        }
    }