AspNetPager分页控件说明
来源:互联网 发布:画线工具源码 编辑:程序博客网 时间:2024/06/06 20:53
使用方法:(AspNetPager.dll百度一下哦)
1、将AspNetPager.dll拷贝至站点文件夹下的Bin文件夹中,
如果站点中无Bin文件夹,可在站点中点击右键-添加ASP.NET文件夹
2、在VS2005工具箱中“常规”选项卡中点右键选择“选择项…”
点击“浏览…”,找到站点中的AspNetPager.dll后确定,工具箱中常规中出现了它
4、使用分页功能时,将AspNetPager分页控件拖曳至相应页面,编码即可。
5、页面.aspx里添加代码:
<!--分页控件--->
<webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True"
CustomInfoHTML="共%PageCount%页,当前为第%CurrentPageIndex%页"
FirstPageText="首页" LastPageText="尾页" LayoutType="Table" NextPageText="后页"
OnPageChanging="AspNetPager1_PageChanging" PageSize="5"
PagingButtonLayoutType="Span" PrevPageText="前页"
ShowBoxThreshold="2" ShowCustomInfoSection="Right"
ShowNavigationToolTip="True" SubmitButtonText="Go" TextAfterPageIndexBox="页"
TextBeforePageIndexBox="转到" Width="757px">
</webdiyer:AspNetPager>
6、//页面处理类代码:
public partial class Ship : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.AspNetPager1.RecordCount = UserManage.getPageCount();
databind();
}
}
public void databind()
{
int pagesize = this.AspNetPager1.PageSize;
int pageindex = (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize;
DataSet ds = UserManage.getPage(pagesize, pageindex);
//空间绑定数据
this.RepeaterSR.DataSource = ds.Tables[0];
this.RepeaterSR.DataBind();
}
protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
{
this.AspNetPager1.CurrentPageIndex = e.NewPageIndex;
databind();
}
}
7、//辅助类代码:
class UserManage
{
public static DataSet getPage(int pagesize, int pageindex)
{
//调用Sqlhelper
SqlHelper sq = new SqlHelper();
string strsql = "select top " + pagesize + " * from 表 where 主键 not in (select top " + pageindex + " Si_Id from 表) order by 主键";
DataSet ds =sq.ExecuteDataset(System.Data.CommandType.Text,strsql,null);
return ds;
}
/// <summary>
/// 分页总数
/// </summary>
/// <param name="tablename"></param>
/// <returns></returns>
public static int getPageCount()
{
//调用Sqlhelper
SqlHelper sp = new SqlHelper();
string strsql = "select count(Si_Id) from t_ShipInfo ";
int count = Convert.ToInt32(sp.ExecuteScalar(System.Data.CommandType.Text,strsql,null));
return count;
}
}
- AspNetPager分页控件说明
- AspNetPager分页控件
- AspNetPager分页控件
- AspNetPager分页控件
- AspNetPager分页控件
- AspNetPager分页控件
- AspNetPager分页控件
- AspNetPager分页控件
- AspNetPager分页控件
- aspnetpager.dll分页控件
- aspnetpager分页控件源码
- AspNetPager分页控件 最新动态
- AspNetPager分页控件
- AspNetPager分页控件--使用方法
- AspNetPager分页控件使用方法
- AspNetPager分页控件
- AspNetPager分页控件
- AspNetPager控件分页使用方法
- hibernate使用sum聚集函数,时间段为查询条件连接SQL2005
- Linux /etc/profile文件详解
- UMDF filter驱动开发学习
- C/C++基础知识:typedef用法详细小结
- hdu 1423 greatest common increasing subsequence
- AspNetPager分页控件说明
- 第二篇-双向链表
- 程序员从初级到中级10个秘诀
- 新手
- 解决SP2010的CQWP匿名访问时SetDocumentIconUrlAndOnClickString方法错误
- 《C#编程之道》 之 如何将前台线程改为后台线程
- PL/SQL 11g R2 —— 异常处理
- ha!!!
- JSVM9_19中class AccessUnit解释说明(待续)