コード例 #1
0
        public void dlBind()
        {
            int             curpage   = Convert.ToInt32(labNowPage.Text);
            PagedDataSource ps        = new PagedDataSource();
            string          messageNo = Request["ID"].ToString();
            DataTable       dsTable   = Bmessage.GetList("messageNo=" + messageNo).Tables[0];

            ps.DataSource       = dsTable.DefaultView;
            ps.AllowPaging      = true;        //是否可以分页
            ps.PageSize         = 10;          //显示的数量
            ps.CurrentPageIndex = curpage - 1; //取得当前页的页码
            lnkbtnPrve.Enabled  = true;
            lnkbtnTop.Enabled   = true;
            lnkbtnNext.Enabled  = true;
            lnkbtnLast.Enabled  = true;
            if (curpage == 1)
            {
                lnkbtnTop.Enabled  = false; //不显示第一页按钮
                lnkbtnPrve.Enabled = false; //不显示上一页按钮
            }
            if (curpage == ps.PageCount)
            {
                lnkbtnNext.Enabled = false; //不显示下一页
                lnkbtnLast.Enabled = false; //不显示最后一页
            }
            this.labCount.Text          = Convert.ToString(ps.PageCount);
            this.DataList1.DataSource   = ps;
            this.DataList1.DataKeyField = "ID";
            this.DataList1.DataBind();
        }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string    id      = Request["ID"].ToString();
         DataTable dsTable = Bmessage.GetList("MESSAGEnO=" + id).Tables[0];
         if (dsTable.Rows.Count > 0)
         {
             this.txtSubject.Text = dsTable.Rows[0]["Subject"].ToString();
         }
         /*判断是否登录*/
         ST_check_Login();
     }
 }