Posts Tagged programmer

ASP.NET coding and SEO

I found that there is not much information available on the Net about how to optimize your ASP.NET pages so that they may be found on Google.

Here are a few tips:

  1.  Use the System.Web.UI.HtmlControls.HtmlMeta class for meta headers. Initialize, set the value and add to page.header.controls.
  2. Use  this.Title = “Title here”;
  3. For Anchor tags, use this format <a runat=”server” href = “~/Folder/FileName.aspx”>link text </a> . The runat=”server” part is most important or else, maintaining your link integrity is a headache.
  4. If you use SessionIds, try not to do that via the querystring. If on separate tries, the spider sees different URLs, it may take them as different pages.  Of course, later on it may flag all those other pages as duplicate, but your bandwidth is wasted unnecessarily.
  5. Put your links on the Master page so that the same links are available from every page.  Add additional links to your important pages from the body copy.
  6. Postbacks are not very good for SEO.  If you are displaying content only on the click of a button or some other user action, the content may not be available to the spider.
  7. Avoid the use of hyperlinkbuttons.  They include javascript code instead of actual links that may or may not be read by the spider. Use regular anchor tags as in point 3 above.
  8. Do not put the link to the copyright notice(or web-designer email) on the Master Page. It gets copied on every content page and takes away from the ranking of other links. If you must, make sure the spider does not follow it by using rel=”nofollow”.
  9. Viewstate. This is a problem if you are trying to optimize pages with a lot of dataentry objects like text boxes and dropdowns. ASP.NET creates a hidden variable and posts it back to the page with a lot of encrypted data that stores the state of the controls on  the page. Spiders may find the keywords way down on the page, and your keyword density may also suffer because of the added viewstate data.  This is not often an issue with regular text only pages.

 

Please let me know if I am missing any obvious ones.

I have posted a full report with code on my site — http://www.google-seo-tools.com/Articles/ASP-NET-Coding-SEO/Default.aspx .

 

 

 

 

 

Comments (3)