repeater控制項分頁

2021-05-26 22:09:14 字數 1487 閱讀 1844

#region 資料來源繫結、分頁

///

/// 初始資料繫結

///

public void databindtorepresouce(string condition)

else

int curpage = convert.toint32(this.la_page.text);

pageddatasource ps = new pageddatasource();

}if (curpage == ps.pagecount)//獲取顯示資料來源中的所有項所需要的總頁數

this.la_count.text = convert.tostring(ds.tables[0].rows.count);

this.la_pagecount.text = convert.tostring(ps.pagecount);

this.represource.datasource = ps;

this.represource.databind();

this.droppage.items.clear();

for (int i = 1; i <= convert.toint32(this.la_pagecount.text); i++)

this.droppage.selectedindex = convert.toint32(this.la_page.text) - 1;

}///

/// 繫結類別資訊

///

public void databindtoddltype()

///

/// 繫結類別資訊

///

public void databindtoserchddltype()

///

/// 獲取類別名

///

///

///

public string gettype(object value)

public string gettype(string id)

///

/// 首頁

///

///

///

///

///

///

///

protected void lbt_next_click(object sender, eventargs e)

///

/// 尾頁

///

///

///

protected void lbt_tail_click(object sender, eventargs e)

///

/// 轉至

///

///

///

protected void droppage_selectedindexchanged(object sender, eventargs e)

#endregion 資料來源繫結、分頁

repeater控制項實現分頁

分頁分為真分頁和假分頁。假分頁 從資料庫一次性取出所有資料繫結到控制項上,再將所有資料根據一頁顯示多少條而分頁。從以上二者的概念上我們可以看出,區別在於分頁時從資料庫讀取資訊的方式,真分頁的效率無疑是最高的。假分頁在首次頁面載入的時候會比較慢 如果資料量較多 二者其實各有各的優缺點,可根據需要來自行...

分頁繫結repeater控制項

booklist.aspx.cscode using system using system.data using system.configuration using system.collections using system.web using system.web.security usi...

Repeater控制項分頁例子

repeater控制項分頁例子 repeater和datalist控制項提供了乙個快速 靈活的表現資料的方式,但是,它們沒有內建的分頁功能 datagrid控制項提供了內建的分頁功能,但它的結構比較複雜。下面就用pageddatasource類實現repeater和datalist的分頁。paged...