当前位置:编程学习 > C#/ASP.NET >>

如何取得ObjectDataSource查询得到的总记录数

使用ObjectDataSource自定义分页,设置了EnablePaging="True",SelectCountMethod="SelectCountRows",分页正常。现在的问题是我需要取得ObjectDataSource的总页数与总记录数,如何取到这两个值???

部分代码:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    DataSourceID="ObjectDataSource1" PageSize="5">
                    <PagerSettings PageButtonCount="5" />
                </asp:GridView>

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetFPInfo" 
        TypeName="FP.BLL.FPInfo" EnablePaging="True" 
        SelectCountMethod="SelectCountRows" 
        onselected="ObjectDataSource1_Selected">
        <SelectParameters>
            <asp:Parameter Name="startRowIndex" Type="Int32" />
            <asp:Parameter DefaultValue="5" Name="maximumRows" Type="Int32" />
            <asp:ControlParameter ControlID="TextBox1" DefaultValue="" Name="fpNam" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource> --------------------编程问答-------------------- 再顶 --------------------编程问答-------------------- http://topic.csdn.net/t/20060527/17/4783165.html --------------------编程问答-------------------- http://www.cnblogs.com/taewind/archive/2006/12/12/589131.html
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,