473,625 Members | 3,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Friendly paging of large data

I am in the process of developing a site that will, on completion, be quite
high profile. I have successfully used the Datagrid to display paged data
from a database of around 10k records, but the standard paging techniques
use a linkbutton, which runs a small piece of client-side javascript.

To my understanding, this means that when I get "spidered" by a search
engine, it won't follow the javascript links, thereby my database won't get
indexed.

Has anyone seen an example whereby a) I'm using standard HTML links, and b)
I'm not loading all 10k records into a dataset every time someone hits the
server? Even classic ASP had it's objRecordset.Pa geSize and
objRecordset.Ab solutePage

Thanks in advance.
Nov 15 '05 #1
1 2366
Hi Duncam,

You can do the same thing in ASP.NET :)

The datagrid have a PageSize and a CurrentPageInde x properties, that you can
use for that matter.

This is what I would do:
1- Read the dataset and keep it in memory on a session variable, ASP.NET has
no thread affinity ( I don't know if that is the correct spelling ; )
therefore you are no compromising the performance of the app.

2- Set the PageSize as needed.

3- Now setting the CurrentPageInde x is the core thing, if you want to get
spider then you need to use GET instead of POST , later you will see how
you can get this from the HTML code using links.
in the Load event you should do something like this:

if ( Request["CurrentPag e"]!="" )
CurrentPageInde x = Convert.ToInt32 ( Request["CurrentPag e"] );
else
CurrentPageInde x = 0;

datagrid.DataBi nd(); /// You have to rebind it after changing the page !!!

this is ALL the code you need in the server side to get to the correct page,
now how to get to the correct page?
Very easy in fact :)
1- Disable the grid default paging , I think remember this is done by
setting the ShowFooter to false
2- Include two asp:LinkButtons in the page these will work like the previous
and next
I will show you only the next, the previous is similar
<asp:HyperLin k NavigateUrl=<%# NextPageUrl()%> "
Visible="<%#Exi stNextPage()%>" ></asp:HyperLink>

This is the code for the methods:
protected string NextPageUrl()
{
return "pagename.aspx? CurrentPage=" + Convert.ToStrin g(
datagrid.Curren tPageIndex + 1);
}
protected bool ExistNextPage()
{
return datagrid.Curren tPageIndex< datagrid.PageCo unt;
}
This should solve your problem, but please remember that I just wrote the
code above, I haven't test it and you may have to fine tuning it.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Duncan Welch" <du**@ntpcl.f9. co.uk> wrote in message
news:ev******** *****@TK2MSFTNG P10.phx.gbl...
I am in the process of developing a site that will, on completion, be quite high profile. I have successfully used the Datagrid to display paged data
from a database of around 10k records, but the standard paging techniques
use a linkbutton, which runs a small piece of client-side javascript.

To my understanding, this means that when I get "spidered" by a search
engine, it won't follow the javascript links, thereby my database won't get indexed.

Has anyone seen an example whereby a) I'm using standard HTML links, and b) I'm not loading all 10k records into a dataset every time someone hits the
server? Even classic ASP had it's objRecordset.Pa geSize and
objRecordset.Ab solutePage

Thanks in advance.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2292
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be fine I think) that will say "I'm sorry but the data you requested cannot be found" or something along those lines.... This code is on an archive page I have on my company's intranet....The end result is to show 3 records at a time pulled from an...
4
3855
by: Paul Hale | last post by:
Hi, Currently using VS2005 c# Scenario: I have a gridview control displaying many items with paging enabled. Column is a checkbox column which users can check, but when the gridview is paged to another page and then back again, the value of the checkbox has been forgotten. Is there a better way of persisting the values through the pages in VS2005 other than writing tedious code behind in the OnPageIndexChanging event? Maybe using the...
2
5035
by: Mark | last post by:
I am attempting to build a repeating list using a repeater control. I want to add a checkbox to each item (line) and 'Select All' and 'Clear All' buttons. I have figured out how to do this until it comes time to implement paging. Without paging I can iterate through the repeater when I click 'Select All' and set the checked property to true for all items in the repeater. However when I implement paging, I have to rebind the repeater...
0
3378
by: anonieko | last post by:
This approach I found very efficient and FAST when compared to the rowcount, or Subquery Approaches. This is before the advent of a ranking function from DB such as ROW_NUMBER() in SQL Server 2005 and the likes of it. So This one works with SQL2000 What do you think?
0
1623
by: Mrozik | last post by:
Hi! I'm looking for a solution to show data in a table. I think about DataView control - but I see one problem. My data source is a WebService returning paged pieces of data (I can't change behavior of this data source). I found in documentation the only way to implement custom paging is to use ObjectDataSource - but there is different model of arguments (page size, page number, sort expression , order expression) of WS methods - there...
7
2322
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
The default paging behavior of the gridview doesn't work well with very large sets of data which means we have to implement some sort of custom paging. The examples I have seen (4guysfromrolla, etc.) suggest using an ObjectDataSource which has built-in paging functionality that, when used in conjunction with certain SQL 2005 functionality, only works with the records to be displayed on the page rather than the entire set. The problem with...
13
2795
by: JJ | last post by:
I have a need to input a large tab delimited text file, which I will parse to check it has the expected columns, before allowing the user to submit it to the database. The user may paste the file into a textbox, or upload it (haven't decided yet). The problem I have is that the text file consists of around 3000 lines, and I want to display the formatted columns to the user before submitting it to the database (perhaps allowing them to...
1
1950
by: John A Grandy | last post by:
In regard to a GridView that must support searching, filtering, sorting, and paging ... There is a tradeoff in performing the sorting and paging in the database versus to creating a CLR sort expression and allowing the GridView to perform the sorting and paging. How do people feel about each option for (1) simple sorts (alphabetical, compound alphabetical)
2
1343
by: Ilyas | last post by:
Hi all I need to implmenet paging across different tables. The tables all have a different name eg Data01, data02 data03 etc, however they are columns which are common to each table, but each table also has some unique columns My questions is that I want to display data from any one of these tables - I wont know which one until runtime, but since they contains large amounts of data, I only want to display say 10 at a time. Also
0
8189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8692
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6116
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1499
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.