protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OA mOA = new OA(); int PageSum = mOA.GetPages(); ShowPages.Text = "第" + (CurrentPage + 1).ToString() + "页/共" + PageSum + "页"; this.OrderList.DataSource = mOA.DivideShow(CurrentPage); this.OrderList.DataBind(); } }
protected void Last_Click(object sender, EventArgs e) { if (CurrentPage > 0) { CurrentPage--; OA mOA = new OA(); int PageSum = mOA.GetPages(); ShowPages.Text = "第" + (CurrentPage + 1).ToString() + "页/共" + PageSum + "页"; this.OrderList.DataSource = mOA.DivideShow(CurrentPage); this.OrderList.DataBind(); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language=javascript>alert('已经是第一页了!!')</script>"); } }