/// set nocount off ///GO /// ]]> /// </code> /// </example> [Browsable(false), Description("要分页的所有记录的总数,该值须在程序运行时设置,默认值为225是为设计时支持而设置的参照值。"), Category("Data"), DefaultValue(225)] public int RecordCount { get { object obj=ViewState["Recordcount"]; return (obj==null)?0:(int)obj; } set{ViewState["Recordcount"]=value;} }
/// <summary> /// 获取当前页之后未显示的页的总数。 /// </summary> [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int PagesRemain { get { return PageCount-CurrentPageIndex; } }
/// <summary> /// 获取或设置每页显示的项数。 /// </summary> /// <remarks> /// 该值获取或设置数据呈现控件每次要显示数据表中的的数据的项数,AspNetPager根据该值和 <see cref="RecordCount"/> 来计算显示所有数据需要的总页数,即 <see cref="PageCount"/>的值。</remarks> /// <example>以下示例将 <see cref="AspNetPager"/> 设置为允许每页显示8条数据: /// <code> /// <![CDATA[ /// ... /// <Webdiyer:AspNetPager id="pager" runat="server" PageSize=8 OnPageChanged="ChangePage"/> /// ... /// ]]></code></example> [Browsable(true), Description("每页显示的记录数"), Category("分页"), DefaultValue(10)] public int PageSize { get { object obj=ViewState["PageSize"]; return (obj==null)?10:(int)obj; } set { ViewState["PageSize"]=value; } }
/// <summary> /// 获取在当前页之后还未显示的剩余记录的项数。 /// </summary> [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int RecordsRemain { get { if(CurrentPageIndex<PageCount) return RecordCount-(CurrentPageIndex*PageSize); return 0;} }
/// <summary> /// 获取所有要分页的记录需要的总页数。 /// </summary> [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int PageCount { get{return (int)Math.Ceiling((double)RecordCount/(double)PageSize);} }
#endregion
#region TextBox and Submit Button
/// <summary> /// 获取或设置页索引文本框的显示方式。 /// </summary> /// <remarks> /// 页索引文件框允许用户手式输入要访问的页的索引,当页数非常多时,显示页索引文本框非常方便用户跳转到指定的页,默认情况下,该文本框只有在总页数大于或等于 <see cref="ShowBoxThreshold"/> 的值时才显示,否则不显示,要想该文本框任何时候都显示,请将其值设为Always,若希望任何时候都不显示,则应设为Never。 ///</remarks> [Browsable(true), Description("指定页索引文本框的显示方式"), Category("文本框及提交按钮"),
上一篇:微软:升级到Vista的100个理由
下一篇:oracle 存储过程的基本语法
|