One of the features of ASP.NET is that it remembers the state of controls that are on the page throughout the page cycle. It does this automatically for you by creating a hidden field called Viewstate.
I researched this recently and found a good forum thread on this topic.
It goes into several methods for working around ASP.NET’s viewstate for SEO.
The first is to disable viewstate all together:
< %@ Page EnableViewState="false" %>
remove the runat=server attribute of the form tag. (I have not tried that)
The second is to minimize the size of the viewstate field by removing the runat=server attribute of all controls you don’t need to remember their state.
The last thing they recommended was to move the viewstate field to the bottom of the page. There is some code there that supposidly did this, but I haven’t tried it. Keep in mind that the post is dated 2004 so I don’t know if it willl work without bugs in ASP.NET 2.0
Here is the excerpt from the post:
Actually…I just found the code in the DNN project…they use it in a base page…if you are not familiar with that it is a class that inherits from Inherits System.Web.UI.Page and then any page you make should inherit from your custom base page. You could also probably copy and past the below code into each of your pages.
' This method overrides the Render() method for the page and moves the ViewState
' from its default location at the top of the page to the bottom of the page. This
' results in better search engine spidering.
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim stringWriter As System.IO.StringWriter = New System.IO.StringWriter
Dim htmlWriter As HtmlTextWriter = New HtmlTextWriter(stringWriter)
Dim html As String = stringWriter.ToString()
Dim StartPoint As Integer = html.IndexOf("<input type=""hidden"" name=""__VIEWSTATE""")
If StartPoint />= 0 Then 'does __VIEWSTATE exist?
Dim EndPoint As Integer = html.IndexOf("/>", StartPoint) + 2
Dim ViewStateInput As String = html.Substring(StartPoint, EndPoint - StartPoint)
html = html.Remove(StartPoint, EndPoint - StartPoint)
Dim FormEndStart As Integer = html.IndexOf("") - 1
If FormEndStart >= 0 Then
html = html.Insert(FormEndStart, ViewStateInput)