Exemplo n.º 1
0
        protected virtual void OnPageIndexChanged(PageChangedEventArgs e)
        {
            PageChangedEventHandler handler = Events[EventPageIndexChanged] as PageChangedEventHandler;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 2
0
        void Change_PageIndex(object sender, EventArgs e)
        {
            //触发了点击事件,则将blnNoClick设为false.
            blnNoClick = false;
            Button btn = (Button)sender;

            if (btn.CommandName == "Page")
            {
                PageChangedEventArgs ee = new PageChangedEventArgs();
                if (btn.CommandArgument == "ButtonFirst")
                {
                    this.CurrentPageIndex = 1;
                }
                if (btn.CommandArgument == "ButtonPrev")
                {
                    this.CurrentPageIndex -= 1;
                }
                if (btn.CommandArgument == "ButtonNext")
                {
                    this.CurrentPageIndex += 1;
                }
                if (btn.CommandArgument == "ButtonLast")
                {
                    this.CurrentPageIndex = this.PageCount;
                }
                if (btn.CommandArgument == "ButtonDiy")
                {
                    int intDiyIdx = 1;
                    //如果输入数字不合法,则跳转到第一页
                    if (int.TryParse(this.txtPageIndex.Text, out intDiyIdx))
                    {
                        if (intDiyIdx > 0)
                        {
                            this.CurrentPageIndex = intDiyIdx;
                        }
                        else
                        {
                            this.Page.RegisterStartupScript("tishi", "<script>alert('页索引必须为大于0的整数');</script>");
                            this.CurrentPageIndex = 1;
                        }
                    }
                    else
                    {
                        this.Page.RegisterStartupScript("tishi", "<script>alert('页索引必须为整数');</script>");
                        this.CurrentPageIndex = 1;
                    }
                }
                ee.CurrentPageIndex = this.CurrentPageIndex;
                ee.PageCount        = this.PageCount;
                ee.PageSize         = this.PageSize;
                ee.RecordCount      = this.RecordCount;
                this.OnPageIndexChanged(ee);
            }
        }
Exemplo n.º 3
0
 void Change_PageIndex(object sender, EventArgs e)
 {
     //触发了点击事件,则将blnNoClick设为false.
     blnNoClick = false;
     Button btn = (Button)sender;
     if (btn.CommandName == "Page")
     {
         PageChangedEventArgs ee = new PageChangedEventArgs();
         if (btn.CommandArgument == "ButtonFirst")
         {
             this.CurrentPageIndex = 1;
         }
         if (btn.CommandArgument == "ButtonPrev")
         {
             this.CurrentPageIndex -= 1;
         }
         if (btn.CommandArgument == "ButtonNext")
         {
             this.CurrentPageIndex += 1;
         }
         if (btn.CommandArgument == "ButtonLast")
         {
             this.CurrentPageIndex = this.PageCount;
         }
         if (btn.CommandArgument == "ButtonDiy")
         {
             int intDiyIdx = 1;
             //如果输入数字不合法,则跳转到第一页
             if (int.TryParse(this.txtPageIndex.Text, out intDiyIdx))
             {
                 if (intDiyIdx > 0)
                 {
                     this.CurrentPageIndex = intDiyIdx;
                 }
                 else
                 {
                     this.Page.RegisterStartupScript("tishi", "<script>alert('页索引必须为大于0的整数');</script>");
                     this.CurrentPageIndex = 1;
                 }
             }
             else
             {
                 this.Page.RegisterStartupScript("tishi", "<script>alert('页索引必须为整数');</script>");
                 this.CurrentPageIndex = 1;
             }
         }
         ee.CurrentPageIndex = this.CurrentPageIndex;
         ee.PageCount = this.PageCount;
         ee.PageSize = this.PageSize;
         ee.RecordCount = this.RecordCount;
         this.OnPageIndexChanged(ee);
     }
 }
Exemplo n.º 4
0
 protected virtual void OnPageIndexChanged(PageChangedEventArgs e)
 {
     PageChangedEventHandler handler = Events[EventPageIndexChanged] as PageChangedEventHandler;
     if (handler != null)
     {
         handler(this, e);
     }
 }