Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2009, 03:53 PM
Authorized User
 
Join Date: Jun 2009
Posts: 32
Thanks: 17
Thanked 0 Times in 0 Posts
Default GetThreadByID and custom pagination vs automatic paging

Hi

1) ( page 399 ) Post.GetThreadByID method retrieves all posts of a thread via tbh_Forums_GetThreadByID stored procedure. This procedure doesn’t support pagination and in thus it returns all the records from the DB.

Since this procedure doesn’t support pagination, I fail to see the point in objPosts ( objPosts is object data source control defined in page ShowThread.aspx ) implementing custom pagination?!
Namely, advantage of custom pagination over automatic paging is that custom pagination enables you to minimize the bandwidth usage by retrieving only rows for the currently displayed page, while automatic paging retrieves all the rows from DB.
Since our procedure retrieves all the records, I would think that it would make more sense for objPosts to implement automatic paging instead of custom pagination and that way save us some coding time?! Or am I missing something?





b) Anyways, I assume the following logic ( GetThreadByID method on page 399 ) is needed to only return as many Post objects as GridView expects based on maximumRows parameter value:

Code:
         int count = (posts.Count < startRowIndex + maximumRows ? posts.Count - startRowIndex : maximumRows);
           Post[] array = new Post[count];
           posts.CopyTo(startRowIndex, array, 0, count);
           return new List<Post>(array);
To reiterate my previous point, if objPosts implemented automatic paging instead, then we wouldn’t need the above code and thus we’d save us some coding time?!


thanx





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Paging Manoj Bisht ASP.NET 3.5 Professionals 2 August 28th, 2009 05:23 AM
custom paging and sorting? asptwodev BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 September 22nd, 2007 02:06 AM
Chp.12 'custom' SqlDataSource and paging studen77 BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 8 April 4th, 2007 05:49 PM
Custom Paging with Limited numeric links kudzuconf ASP.NET 1.x and 2.0 Application Design 0 October 13th, 2006 03:04 PM
Objectdatasource, Custom Paging, and Filtering crimsondr ASP.NET 2.0 Professional 0 December 23rd, 2005 12:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.