search
Homephp教程php手册AspNetAjaxPager,Asp.Net通用无刷新Ajax分页控件,支持多样式多数据绑定

本控件可以对GridView,Repeater,DataGrid,DataList...几乎所有的.net数据绑定控件进行分页,全部无刷新,数据绑定部分可以使用存储过程也可以直接使用sql语句,这对本控件没有任何干扰!本控件具有较好的用户界面,能够根据需要变换各种样式,配合css控制效果则更好!
1.分页样式效果图:

2.如何使用:
于bin目录下添加:AspNetAjaxPager.dll引用
aspx文件内容:

复制代码 代码如下:








AspNetAjaxPager使用Demo

























编号 姓名 年龄











BackColor="Transparent" BorderColor="Red" BorderWidth="0px" DescriptionText="当前使用中:" GotoButtonValue="转到"
CssClass="navi" IsGotoSelectVisible="False" IsGotoTextBoxVisible="False" LeftPageSize="0" RightPageSize="0" CurrentNumberBgColor="White" />





BackColor="Transparent" BorderColor="Red" BorderWidth="0px" DescriptionText="" GotoButtonValue="转到" CssClass="navi"
RecordCount="1500" IsGotoSelectVisible="False" IsGotoTextBoxVisible="False"/>




BackColor="Transparent" BorderColor="Red" BorderWidth="0px" DescriptionText="" GotoButtonValue="转到" CssClass="navi"
RecordCount="1500" IsGotoSelectVisible="False"/>




BackColor="Transparent" BorderColor="Red" BorderWidth="0px" CssClass="navi" DescriptionText=""
GotoButtonValue="转到"
PagedControlID="Repeater1" RecordCount="1500" />




BackColor="DarkGray" BorderColor="Red" BorderWidth="1px" CssClass="navi" DescriptionText=""
GotoButtonValue="转到" IsGotoSelectVisible="False"
PagedControlID="Repeater1" RecordCount="1500" CellSpacing="1px" />






BackColor="Transparent" BorderColor="Red" BorderWidth="0px" CssClass="navi" DescriptionText=""
GotoButtonValue="转到" IsGotoTextBoxVisible="False"
PagedControlID="Repeater1" RecordCount="1500" LinkIsText="False" NextLink="img/next.gif" FirstLink="img/first.gif" LastLink="img/last.gif" PreviousLink="img/previous.gif" />




BackColor="Transparent" BorderColor="Red" BorderWidth="0px" CssClass="navi" DescriptionText=""
GotoButtonValue="转到" IsGotoSelectVisible="False" IsGotoTextBoxVisible="False"
PagedControlID="Repeater1" RecordCount="1500" CurrentNumberBgColor="Yellow" CurrentPageColor="Lime" LinkNumberWidth="20px" />











.cs文件内容:

复制代码 代码如下:


//======================================================================
// 公司名称: 野人网络工作室(http://www.wildren.com)
// 机器名称: WWW-BBE63F97A80
// 注册组织名: Lenovo (Beijing) Limited
// CLR版本: 2.0.50727.1433
// 文件名称: Default.aspx.cs
// 创建者: 邵龙
// 创建时间: 2009-4-4 16:29:49
// 程序版本: 1.0版
// 功能描述: AspNetAjaxPager使用Demo
// 修改记录:
//======================================================================
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using AspNetAjaxPager.Delegate;
namespace Demo
{
public partial class _Default : System.Web.UI.Page
{
private OleDbConnection conn;
private OleDbCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
this.BindData(this.Pager1.CurrentPageIndex, this.Pager1.PageSize);
}
else
{
///点击分页导航时由控件代理对象触发绑定事件重新显示数据
this.Pager1.OnPageIndexChanged = new PageIndexChangedDelegate(BindData);
}
}
///


/// 绑定Repeater数据
///

///
///
public void BindData(int PageIndex, int PageSize)
{
int intStartIndex = (PageIndex - 1) * PageSize + 1;
int intEndIndex = PageIndex * PageSize;
conn = new OleDbConnection();
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/app_data/db.mdb");
cmd = conn.CreateCommand();
conn.Open();
///此部分可以换成存储过程分页,对控件没有任何影响
cmd.CommandText = "select count(*) from students";
int totalCount = (int)cmd.ExecuteScalar();
cmd.CommandText = string.Format("select * from students where id >= {0} and id DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(cmd.CommandText, conn);
da.Fill(ds);
this.Pager1.RecordCount = totalCount;
this.Repeater1.DataSource = ds;
this.Repeater1.DataBind();
}
}
}

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
在 iPhone 上刷新网页的 6 种方法在 iPhone 上刷新网页的 6 种方法Feb 05, 2024 pm 02:00 PM

当您在iPhone上浏览网页时,加载的内容会暂时存储,只要浏览器应用保持打开状态。然而,网站会定期更新内容,因此刷新页面是清除旧数据并查看最新发布内容的有效方式。这样,您可以始终获得最新的信息和体验。如果您想在iPhone上刷新页面,以下帖子将向您解释所有方法。如何在Safari上刷新网页[4种方法]有几种方法可以刷新您在iPhone上的Safari浏览器App上查看的页面。方法1:使用“刷新”按钮刷新您在Safari浏览器上打开的页面的最简单方法是使用浏览器标签栏上的“刷新”选项。如果Safa

如何下载适用于通用 PnP 监视器的驱动程序:5 种方法如何下载适用于通用 PnP 监视器的驱动程序:5 种方法Apr 21, 2023 pm 08:55 PM

如果您最近升级到Windows10或Windows11,您可能需要在您的PC上下载通用PnP显示器驱动程序。因此,我们想出了一个教程,它将告诉您更多关于通用PnP监视器和一些在Windows上下载和安装通用PnP驱动程序的快速方法。您可能需要下载大多数显示器品牌的驱动程序,包括AcerGenericPnP显示器驱动程序。在设备管理器或显示适配器属性的监视器选项卡下查找监视器类型时,您可能会注意到通用PnP监视器。有机会在笔记本电脑和台式机的双显示器设置中找到它。下

F5刷新密钥在Windows 11中不起作用F5刷新密钥在Windows 11中不起作用Mar 14, 2024 pm 01:01 PM

您的Windows11/10PC上的F5键是否无法正常工作?F5键通常用于刷新桌面或资源管理器或重新加载网页。然而,我们的一些读者报告说,F5键正在刷新他们的计算机,并且无法正常工作。如何在Windows11中启用F5刷新?要刷新您的WindowsPC,只需按下F5键即可。在某些笔记本电脑或台式机上,您可能需要按下Fn+F5组合键才能完成刷新操作。为什么F5刷新不起作用?如果按下F5键无法刷新您的电脑或在Windows11/10上遇到问题,可能是由于功能键被锁定所致。其他潜在原因包括键盘或F5键

如何快速刷新网页?如何快速刷新网页?Feb 18, 2024 pm 01:14 PM

页面刷新在我们日常的网络使用中非常常见,当我们访问一个网页后,有时候会遇到一些问题,比如网页加载不出来或者显示不正常等。这时候我们通常会选择刷新页面来解决问题,那么如何快速地刷新页面呢?下面我们就来探讨一下页面刷新的快捷键。页面刷新快捷键是一种通过键盘操作来快速刷新当前网页的方法。在不同的操作系统和浏览器中,页面刷新的快捷键可能有所不同。下面我们以常见的W

jquery ajax报错403怎么办jquery ajax报错403怎么办Nov 30, 2022 am 10:09 AM

jquery ajax报错403是因为前端和服务器的域名不同而触发了防盗链机制,其解决办法:1、打开相应的代码文件;2、通过“public CorsFilter corsFilter() {...}”方法设置允许的域即可。

Nginx中404页面怎么配置及AJAX请求返回404页面Nginx中404页面怎么配置及AJAX请求返回404页面May 26, 2023 pm 09:47 PM

404页面基础配置404错误是www网站访问容易出现的错误。最常见的出错提示:404notfound。404错误页的设置对网站seo有很大的影响,而设置不当,比如直接转跳主页等,会被搜索引擎降权拔毛。404页面的目的应该是告诉用户:你所请求的页面是不存在的,同时引导用户浏览网站其他页面而不是关掉窗口离去。搜索引擎通过http状态码来识别网页的状态。当搜索引擎获得了一个错误链接时,网站应该返回404状态码,告诉搜索引擎放弃对该链接的索引。而如果返回200或302状态码,搜索引擎就会为该链接建立索引

什么是ajax重构什么是ajax重构Jul 01, 2022 pm 05:12 PM

ajax重构指的是在不改变软件现有功能的基础上,通过调整程序代码改善软件的质量、性能,使其程序的设计模式和架构更合理,提高软件的扩展性和维护性;Ajax的实现主要依赖于XMLHttpRequest对象,由于该对象的实例在处理事件完成后就会被销毁,所以在需要调用它的时候就要重新构建。

如何在Windows 11个人电脑和笔记本电脑上禁用通用水印?如何在Windows 11个人电脑和笔记本电脑上禁用通用水印?Apr 21, 2023 pm 02:49 PM

您是否对Windows11屏幕右下角的恼人水印感到困扰?你不知道如何删除它?适用于Windows11的UniversalWatermarkDisabler是一种工具,可以帮助删除Windows屏幕右下角干扰壁纸和整体体验的烦人水印。事不宜迟,让我们开始吧。从Windows11中删除水印的3种解决方案1.使用UniversalWatermarkDisabler去除水印在Windows11中删除评估副本水印的最简单方法是使用通用水印禁用程序,这是一个第三方免费软件

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft