An ASP.NET Ajax SEO Idea
This is my first post on here so I hope it is helpful.
I was playing around with an idea of making a site where the content was loaded into the page with ajax. So I changed my links to LinkButtons and made these pass the ID of the page to load.
After getting this running I thought to myself, using these link buttons I have just hidden all my content from any search engine as the LinkButton's href attribute is a javascript call and a searchengine will not be able to follow this. Then I came up with an Idea, wh not change the link so that the normal href would pass a query string with the id to the page to load this way if the user has javascript off or a search engne is crawling the site they will still be able to see the content, and if the user has javascript on they will get the ajax based version of the site.
To this this I did the following things:
1. Set the href attribute to be the non ajax version of the page i.e. page.aspx?ID=x
2. Add an onclick attribute which would be the javascript postback, which inturn would use the ajax based version of the page.
3. On the page load check to see if the ID is passed in as a query string and if so load the content.
4. Handle the onclick of the LinkButton to load the content using AJAX.
An issue with this is that by adding a secound href attribute there are now two, the original javascript one and the new url based one, I dont think this is ready just yet for use, but I will be making a new SEO friendly link button control soon.
Hope you find this useful, any feedback would be good.
Cheers
Stefan Sedich