2

I've just taken my first stab at making a ListView, ObjectDataSource, and DataPager run in an AJAX panel.

I had trouble getting it to work until I removed the QueryStringField="page" attribute from the DataPager. This attribute causes the current page to be passed as a query argument in the URL. For obvious reasons, I guess that won't work when posting back using AJAX.

Now my question is if this hurts my SEO. When I used QueryStringField, the page links appeared as regular links with various query arguments. But now the links are just javascript. Haven't I hurt a search engine's ability to scan related pages?

Or is there another approach to this?

Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466

1 Answers1

0

If you run a paging control or any control which has not been written to degrade gracefully without javascript then you will be making any navigable pages essentially invisible to search engines.

As a rule, just view source on the page and see what links are available on the page. Only these links will be visible to search engines.

To get search engine coverage AND emply AJAX on your pages which page, first write them to work with standard postbacks and pretty urls (routing /url rewriting) then add AJAX on top.

It can be a PITA but essentially you will need to write the code twice.

Would love to hear if anyone has any better suggestions.

I've been writing stuff in .NET without controls or webforms just pure HTML and using Jquery to add any magic.

Hopefully we will be moving over to MVC soon.

Just my biased take on the way we should be heading...

CountZero
  • 6,171
  • 3
  • 46
  • 59
  • I'm not sure I follow. I **did** get it working first using standard links. But, as near as I can tell, that is simply not compatible with AJAX. Unless I'm missing something, my choice is use regular links and query arguments **or** AJAX, but not both. Did I miss something? – Jonathan Wood Dec 28 '10 at 03:35
  • I think you may be able to address your issue with the solution presented here. http://weblogs.asp.net/stefansedich/archive/2008/02/08/fully-accessible-ajax-paging-using-datapager.aspx. I really dont like working with many of the bundled webcontrols such as gridviews and data pager controls - as soon as you desire custom bheaviour things get ugly and complexvery quickly. I would recommend using JQuery and a paging control such as this http://blog.wekeroad.com/2007/12/10/aspnet-mvc-pagedlistt/. You get full control and avoid any MS 'magic' which more often than not will ruin your day ;) – CountZero Dec 28 '10 at 13:18
  • That looks like a promising article. Thanks. – Jonathan Wood Dec 28 '10 at 14:47