Example #1
0
        /// <summary>
        /// ���˿ؼ����ָ�ָ�������������
        /// </summary>
        /// <param name="output"> Ҫд������ HTML ��д�� </param>
        protected override void Render(HtmlTextWriter output)
        {
            output.WriteLine( "<input type='hidden'name='" + this.UniqueID + "_PageArgs' value='" +
                this.recordCount + "," + this.pageCount+ "," + this.currentPageIndex + ","+this.pageSize+"'>" );

            if( this.recordCount <= 0 ) //�Զ�����
            {
                if( displayMode == DisplayMode.AutoHidden )
                    return ;
                else if( displayMode == DisplayMode.AutoHiddenBeforePost && false == Page.IsPostBack )
                    return ;
            }

            if( this.Controls.Count != 0 ) //�����ģ��
                base.Render( output );
            else
            {
                PagerTemplate temp = new PagerTemplate( this );

                base.RenderBeginTag( output ) ;
                output.Write( "<table align='"+this.horizontalAlign.ToString()+"'>" );
                output.Write( "<tr>" );
                if( this.Mode == TPagerMode.NextPrev )
                {
                    output.Write( "<td valign=middle>" );
                    output.Write( temp.PrePageLink + "&nbsp;" + temp.NextPageLink );
                    output.Write( "</td>" );
                }
                else if( this.Mode == TPagerMode.NumericPages )
                {
                    output.Write( temp.NumericLinks );
                }
                else if( this.Mode == TPagerMode.Standard )
                {
                    output.Write( "<td valign=center align='left' width='40%' valign=middle nowrap >" );

                    output.Write( string.Format( "��ǰҳ�룺{0} ��ҳ����{1} ÿҳ��{2} ������{3} " , this.CurrentPageIndex + 1 , this.pageCount ,this.pageSize ,this.recordCount  ) );

                    output.WriteLine( " &nbsp; "  );

                    output.WriteLine( "</td><td valign=center align='center' nowrap valign=middle>"  );
                    output.Write( "��" + temp.PrePageLink + "��&nbsp;��" + temp.NextPageLink + "��" );

                    output.WriteLine( "</td><td valign=center align='right' width='30%' nowrap valign=middle'>"  );
                    output.WriteLine( temp.PageNumInput  );
                    output.WriteLine( "</td>"  );
                }
                else if( this.Mode == TPagerMode.Default )
                {

                    output.Write( "<td valign=center align='center' width='40%' valign=middle nowrap >" );

                    output.Write( string.Format( "��ǰҳ�룺{0} ��ҳ����{1} ÿҳ��{2} ������{3} " , this.CurrentPageIndex + 1 , this.pageCount ,this.pageSize ,this.recordCount  ) );

                    output.Write( "��" + temp.PrePageLink + "��&nbsp;��" + temp.NextPageLink + "��" );
                    output.Write( "ת��" );
                    output.Write( temp.PageNumSelect  );

                    output.WriteLine( " &nbsp; "  );

                    output.Write( "ÿҳ" );
                    output.Write( temp.PageSizeChange  );
                }

                output.Write( "</tr>" );
                output.Write( "</table>" );

                base.RenderEndTag( output ) ;

            }
        }
Example #2
0
        /// <summary>
        /// ģ�洦��
        /// </summary>
        protected override void CreateChildControls()
        {
            //base.CreateChildControls ();

            if( this._template != null )
            {
                PagerTemplate temp = new PagerTemplate( this );

                this._template.InstantiateIn( temp );

                this.Controls.Add( temp ) ;
            }

            base.ChildControlsCreated = true ;
        }