Public Function GetMyRecord(ByVal startRowIndex As Integer, ByVal maximumRows As Integer, ByVal sortExpression As String) As DataTable '*' Code to retrieve Record from SP Return result End Function Public Function GetMyRecordCount() As Integer '*' Code to retrieve Record Count Return recordCount End FunctionASPX
<asp:ObjectDataSource ID="myDataSource" runat="server" SelectMethod="GetMyRecord" TypeName="MyProj.BO.MyTable" EnablePaging="True" SelectCountMethod="GetMyRecordCount" SortParameterName="sortExpression"> <selectparameters> <asp:Parameter Name="startRowIndex" Type="Int32"></asp:Parameter> <asp:Parameter Name="maximumRows" Type="Int32"></asp:Parameter> <asp:Parameter Name="sortExpression" Type="String"></asp:Parameter> </selectparameters> </asp:ObjectDataSource>Do I need to manually get the PageIndex and MaxRows from CodeBehind, or there is an easier approach? Also, is the function specified in the the SelectCountMethod must be a function in ASPX code behind?