public int PageIndex
{
get { return (int)ViewState["pageIndex"]; }
set
{
if ((int)value >= 1 && (int)value <= (int)ViewState["PageCount"])
ViewState["pageIndex"] = value;
}
}
public void BinerToDataList()
{
IList<Topic> topics = GetAllProducts("SELECT top " + pageSize + " * FROM [bbstopic] where tid not in(select top " + (PageIndex - 1) * pageSize + " tid from [bbstopic])");
//
this.DataList1.DataSource = topics;
this.DataList1.DataBind();
}
public IList<Topic> GetAllProducts(string strsql)
{
IList<Topic> topics = new List<Topic>();
using (SqlDataReader sdr = SqlHelper.GetReader(strsql))
{
while (sdr.Read())
{
Topic top = new Topic();