1
大家好我有一個頁面,需要從一個SQL數據源的項目,並把它們放入一箇中繼器。我想知道如何改變pagedDatasource的頁面索引當我點擊另一個按鈕更改pageDataSource頁面
頁面加載
DataSourceSelectArguments arg = new DataSourceSelectArguments();
arg.MaximumRows = 8;
arg.AddSupportedCapabilities(DataSourceCapabilities.Page);
DataView set = (DataView)SQLDataSourceProducts.Select(arg);
int rows = arg.TotalRowCount;
PagedDataSource paged = new PagedDataSource();
paged.DataSource = set;
paged.AllowPaging = true;
paged.PageSize = 3;
int pageIndex = 1;
paged.CurrentPageIndex = pageIndex - 1;
RepeaterProducts.DataSource = paged;
RepeaterProducts.DataBind();
上的按鈕按下
protected void moreButton_Click(object sender, EventArgs e)
{
//Change the pageIndex
}
感謝所有