Make the ASP.NET DataPager SEO friendly?

Currently I’m working on a brand new .NET Framework v4 Project which is using all the new stuff of the new framework version. So I decided to try out the ASP.NET DataPager once more. It was introduced in previous .NET Versions already. However, at the beginning it only provided Javascript/Postback URLs which were not crawlable by searchengines. I mentioned that on Scott Gu’s Blog back in the day, maybe that helped the process to include a “QueryString” Option. You can define the DataPager using this options:

 <asp:DataPager runat="server" ID="DataPager1" PageSize="10" PagedControlID="listViewProducts" QueryStringField="pageNumber">

By using the “QueryStringField” option it at least won’t create uncrawlable Javascript/Postback Links. However, URLs like www.domain.com/?pageNumber=2 still won’t satisfy my needs. The best solution would be to integrate the Datapager with URL Routing. What we need for SEO is Static URLs like www.domain.com/page/2/ and nothing less! I saw a post on codeproject which explains how to extend the Datapager using that kind of searchengine friendly URLs, but it got some annoying limitations:

  • It does not support postback for paging.
  • Only the Next/Previous etc., pager style is supported, not a list of page numbers with direct jump capability.
  • There is no declarative way to display paging information (e.g., “showing items 1-10 from 100, page 1 of 10”).

Due to those facts I unfortunately still need to use my own custom solution. I would love to see a Datapager / URL Routing integration in the future!

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment