473,499 Members | 1,909 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.PageSize and
objRecordset.AbsolutePage

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

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

The datagrid have a PageSize and a CurrentPageIndex 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 CurrentPageIndex 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["CurrentPage"]!="" )
CurrentPageIndex = Convert.ToInt32( Request["CurrentPage"] );
else
CurrentPageIndex = 0;

datagrid.DataBind(); /// 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:HyperLink NavigateUrl=<%#NextPageUrl()%>"
Visible="<%#ExistNextPage()%>" ></asp:HyperLink>

This is the code for the methods:
protected string NextPageUrl()
{
return "pagename.aspx?CurrentPage=" + Convert.ToString(
datagrid.CurrentPageIndex + 1);
}
protected bool ExistNextPage()
{
return datagrid.CurrentPageIndex< datagrid.PageCount;
}
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*************@TK2MSFTNGP10.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.PageSize and
objRecordset.AbsolutePage

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
2289
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...
4
3851
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...
2
5017
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...
0
3371
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...
0
1615
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...
7
2311
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,...
13
2780
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...
1
1937
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...
2
1334
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...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7174
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,...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4919
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...
0
4600
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...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1427
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 ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
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...

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.