热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何使用AspNetPager分页控件和ObjectDataSource控件进行分页

当前路径:AspNetPager741SamplesObjectDataSourceDefault.aspx

当前路径&#xff1a;AspNetPager741Samples/ObjectDataSource/Default.aspx<%&#64; Page Language&#61;"C#" AutoEventWireup&#61;"true" CodeFile&#61;"Default.aspx.cs" Inherits&#61;"ObjectDataSource_Default" MasterPageFile&#61;"~/navpage.master" Title&#61;"AspNetPager示例—ObjectDataSource示例"%><asp:Content runat&#61;"server" ID&#61;"content1" ContentPlaceHolderID&#61;"main"><div>该示例演示如何使用AspNetPager分页控件和ObjectDataSource控件进行分页div><asp:ObjectDataSource ID&#61;"ObjectDataSource1" runat&#61;"server" EnablePaging&#61;"True" SelectCountMethod&#61;"GetOrderCount" SelectMethod&#61;"GetPagedOrders" StartRowIndexParameterName&#61;"startIndex" MaximumRowsParameterName&#61;"pageSize" TypeName&#61;"OrderInfo" OnSelecting&#61;"ODS_Selecting"><SelectParameters><asp:ControlParameter ControlID&#61;"AspNetPager1" PropertyName&#61;"StartRecordIndex" DefaultValue&#61;"1" Name&#61;"startIndex" Type&#61;"Int32" /><asp:ControlParameter ControlID&#61;"AspNetPager1" PropertyName&#61;"PageSize" DefaultValue&#61;"10" Name&#61;"pageSize" Type&#61;"Int32" />SelectParameters> asp:ObjectDataSource><br /><asp:Repeater ID&#61;"Repeater1" runat&#61;"server" DataSourceID&#61;"ObjectDataSource1"><HeaderTemplate><table width&#61;"100%" border&#61;"1" cellspacing&#61;"0" cellpadding&#61;"4" style&#61;"border-collapse:collapse"><tr style&#61;"backGround-color:#CCCCFF"><th style&#61;"width:15%">订单编号th><th style&#61;"width:15%">订单日期th><th style&#61;"width:30%">公司名称th><th style&#61;"width:20%">客户编号th><th style&#61;"width:20%">雇员姓名th>tr>HeaderTemplate><ItemTemplate><tr style&#61;"background-color:#FAF3DC"><td><%#DataBinder.Eval(Container.DataItem,"orderid")%>td><td><%#DataBinder.Eval(Container.DataItem,"orderdate","{0:d}")%>td><td><%#DataBinder.Eval(Container.DataItem, "companyname")%>td><td><%#DataBinder.Eval(Container.DataItem,"customerid")%>td><td><%#DataBinder.Eval(Container.DataItem,"employeename")%>td>tr>ItemTemplate><FooterTemplate>table>FooterTemplate>asp:Repeater><webdiyer:aspnetpager id&#61;"AspNetPager1" runat&#61;"server" AlwaysShow&#61;"True" ShowCustomInfoSection&#61;"Left">webdiyer:aspnetpager>asp:Content>

 

转:https://www.cnblogs.com/wenghaowen/p/3285015.html



推荐阅读
author-avatar
旭峰fd_817
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有