Can gridview paging be set to generate urls instead of postbacks?

J

John Mott

Hi All,

I recently read a post that said that google and other spiders are unable to
navigate paging in the GridView control because it uses postbacks and it
can't determine the url.

I've verified that it doesn't see portions of my site that are on page 2 and
beyond according to whats generated. This is not a good thing if your want
people to find your stuff.

The gridview as it is is so sweet I don't want to give it up. Before
devolving into custom paging is there an option that would have the page
numbers generate urls that a spider could follow instead of calls into the
postback?

Thanks,

John
 
G

Guest

Hello

Recently I have been involved in a thread where we discussed this, you
have some options:

- Implement custom paging (there you can swap to links):
http://www.codeproject.com/useritems/CustomPaging.asp

- Leave the URL issue and generate a sitemap for google (a txt with the
list of all URL's could be a good start), check out google sitemaps.

- There is some trick when you build up the page, check if it's google bot
and change the page size to 1000:

if (Request.ServerVariables["HTTP_USER_AGENT"] == "Googlebot") {
GridView1.PageSize = 1000;
} else {
GridView1.PageSize = 10;
}

Good luck
Braulio


/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------
 
J

John Mott

Thanks Braulio,

I decided to take a third route -- hijack the page row and put in links with
url's in it. I don't have large datasets so i'm not worried about
performance and I'm nervous about the other options.

I created a demo for this:

http://www.nicecleanexample.com/ViewApp.aspx?TID=gridviewnavmod

Like everythign in programming there isn't one right way, just options that
may be useful in certain circumstances..

John
nice clean examples at www.nicecleanexamples.com



Braulio Diez said:
Hello

Recently I have been involved in a thread where we discussed this, you
have some options:

- Implement custom paging (there you can swap to links):
http://www.codeproject.com/useritems/CustomPaging.asp

- Leave the URL issue and generate a sitemap for google (a txt with the
list of all URL's could be a good start), check out google sitemaps.

- There is some trick when you build up the page, check if it's google
bot
and change the page size to 1000:

if (Request.ServerVariables["HTTP_USER_AGENT"] == "Googlebot") {
GridView1.PageSize = 1000;
} else {
GridView1.PageSize = 10;
}

Good luck
Braulio


/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------




John Mott said:
Hi All,

I recently read a post that said that google and other spiders are unable
to
navigate paging in the GridView control because it uses postbacks and it
can't determine the url.

I've verified that it doesn't see portions of my site that are on page 2
and
beyond according to whats generated. This is not a good thing if your
want
people to find your stuff.

The gridview as it is is so sweet I don't want to give it up. Before
devolving into custom paging is there an option that would have the page
numbers generate urls that a spider could follow instead of calls into
the
postback?

Thanks,

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,811
Latest member
SaulFernan

Latest Threads

Top