protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["surrentPage"] = 0; int CurrentPage = Convert.ToInt32(ViewState["surrentPage"]); EA mEA = new EA(); int Page = mEA.GetPages(); ShowPages.Text = "第" + (CurrentPage + 1).ToString() + "页/共" + Page.ToString() + "页"; divide mdv = new divide(); this.EvaluateList.DataSource = mdv.EvaluateShow(Convert.ToInt32(ViewState["surrentPage"])); this.EvaluateList.DataBind(); } }
/// <summary> /// 上一页 /// 徐嘉琪 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void last_Click(object sender, EventArgs e) { if (Convert.ToInt32(ViewState["surrentPage"]) > 0) { ViewState["surrentPage"] = Convert.ToInt32(ViewState["surrentPage"]) - 1; int CurrentPage = Convert.ToInt32(ViewState["surrentPage"]); EA mEA = new EA(); int Page = mEA.GetPages(); ShowPages.Text = "第" + (CurrentPage + 1).ToString() + "页/共" + Page.ToString() + "页"; divide mdv = new divide(); this.EvaluateList.DataSource = mdv.EvaluateShow(Convert.ToInt32(ViewState["surrentPage"])); this.EvaluateList.DataBind(); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "已经是第一页!!" + "');</script> "); } }