asp.net中的GridView控件的部分知识点
2024-10-18 21:05:00
<PagerTemplate> <br />
<asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1) + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
<asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First" ></asp:LinkButton>
<asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev" ></asp:LinkButton>
<asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next" ></asp:LinkButton>
<asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last" ></asp:LinkButton>
到第 <asp:TextBox ID="txtPageNumber" runat="server"></asp:TextBox>
<asp:Button ID="btnPage" Text="Go" runat="server" CommandName="MyPage" />
</PagerTemplate>
GridView---数据绑定控件之数据表格
什么是数据源
通过数据源控件可以直接绑定数据 2.可以设置“自动套用格式”来改变样式(外观) 3.可以通过数据源控制实现在线编辑、删除、选中 4.通过自动生成列,可以使GridView从数据源中自动提取列信息 5.GridView可以包含多种列类型:BoundField(绑定列)、CheckBoxField(复选框列)、HyperLinkField(超链接列)、、ImageField(图片列)、ButtonField(按钮列)、CommonField(命令列)、TemplateField(模板列) 6.GridView内置了很多命令:edit、delete、update、cancel、select、自定义命令
其中,TemplateField模板可分为:内容模板、编辑行模板、交替行模板、头模板、尾模板
今天,给大家共享一个关于网站开发中分页的代码,希望可以用上哦,小伙伴们
最新文章
- 导出csv文件示例
- USR-BLE101配置
- linux查找日志技巧
- 解决IDEA自动重置LanguageLevel和JavaCompiler版本的问题
- selenium使用actions.moveToElement处理菜单
- Python 之 【re模块的正则表达式学习】
- HDUOJ----1234 开门人和关门人(浙江大学考研题)
- expect批量分发公钥
- thinkphp的条件的多种写法
- 超赞的.NET办公软件库
- 常见的html面试题
- Springboot-shiro-redis实现登录认证和权限管理
- 虚拟机上的centos7链接不上网络: activation of network connection failed
- vim命令编辑Host文件
- CSRF篇-本着就了解安全本质的想法,尽可能的用通俗易懂的语言去解释安全漏洞问题
- myeclipse连接mysql失败出错,已解决问题
- 高版本sonar安装遇到的坑-sonar 6.6
- Android学习笔记PreferenceFragment的使用
- sys.usb.config webcam
- L232 No methane on Mars