惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
P
Proofpoint News Feed
WordPress大学
WordPress大学
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
腾讯CDC
罗磊的独立博客
P
Privacy International News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Latest news
Latest news
C
Cisco Blogs
Project Zero
Project Zero
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
博客园 - 叶小钗
Spread Privacy
Spread Privacy
博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
博客园 - 聂微东
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tenable Blog
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
L
Lohrmann on Cybersecurity
IT之家
IT之家
T
Tor Project blog
S
SegmentFault 最新的问题
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
月光博客
月光博客
L
LINUX DO - 热门话题
C
CERT Recently Published Vulnerability Notes
T
Threat Research - Cisco Blogs
A
Arctic Wolf
D
DataBreaches.Net
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 【当耐特】
T
The Exploit Database - CXSecurity.com
T
Threatpost
Hacker News - Newest:
Hacker News - Newest: "LLM"
Scott Helme
Scott Helme
博客园 - 司徒正美
Vercel News
Vercel News
H
Help Net Security
N
News and Events Feed by Topic
MyScale Blog
MyScale Blog
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog

博客园 - BlackPhoenix

SQL Server将数据导出SQL脚本的方法 国内Asp.net博客系统收集和简单介绍 1999-2006中国统计年鉴 CodeSmith.Pro.4.1.2破解和注册 office2007的电脑上,右键菜单新建“office2003”文档的办法! 农行动态口令卡问题解决方案(Key:Vista,IE7,证书已锁定,438对象不支持此属性或方法) VS2005Team版如何进行单元测试 解决vista系统部分CHM打不开,“无法正常显示”的问题 序列化- 使用BinaryFormatter进行序列化 C#开源资源大汇总 Windows Vista中微软拼音输入法2007默认是英文标点问题解决 string.format()字符传格式化时特殊字符要进行转义 C#:String.Format数字格式化输出 [coll]ASP.NET刷新页面的六种方法 [转]DataFormatString的使用 [转]中国大学金融专业排名 SQL SERVER的字段类型说明及简单比较 两个月没编程了,现在开工! 结合委托与AJAX,实现无刷新确认对话框的开源用户控件
ASP.NET-GridView的分页功能
BlackPhoenix · 2008-08-02 · via 博客园 - BlackPhoenix

ASP.NET-GridView的分页功能

2007-12-05 19:54

要实现GrdView分页的功能。
操作如下:
1、更改GrdView控件的AllowPaging属性为true。
2、更改GrdView控件的PageSize属性为 任意数值(默认为10)
3、更改GrdView控件的PageSetting->Mode为Numeric等(默认为Numeric)该属性为分页样式。
GridView属性设置好了,从页面上也能看到分页样式。

现在开始实现分页的功能:
1、在<<asp:GridView ID=......>后添加,OnPageIndexChanging="GridView1_PageIndexChanging"
2、在对应的aspx.cs中添加:
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        InitPage(); //重新绑定GridView数据的函数
    }
3、
GridView1.PageIndex = e.NewPageIndex;
完了之后再

重新绑定一下GridView。