Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Constructor 11/23/2008 1:12 PM
I have tried this in various 'protected override void Render(System.Web.UI.HtmlTextWriter writer)' places in Cuyahoga with no success so far:

//Begin custom 'Move ViewState'
int StartPoint = html.IndexOf("<input type=\"hidden\" name=\"__VIEWSTATE\"");
if (StartPoint >= 0) { int EndPoint = html.IndexOf("/>", StartPoint) + 2;
string viewstateInput = html.Substring(StartPoint, EndPoint - StartPoint);
html = html.Remove(StartPoint, EndPoint - StartPoint);
int FormEndStart = html.IndexOf("</form>") - 1;
if (FormEndStart >= 0)
{
html = html.Insert(FormEndStart, viewstateInput);
}
}
//End custom 'Move ViewState'

Anyone successfully moved the ViewState to the bottom of the page? (For SEO reasons).
# Constructor 1/6/2009 3:23 PM (edited 1/6/2009 3:24 PM)
SEO ViewState Adapters for ASP.NET

Download available at bottom of the page: SEOViewState.zip (29.67 KB)

Not yet tested with Cuyahoga, though may be of use.
# Constructor 2/23/2009 5:10 PM (edited 2/23/2009 5:24 PM)
This adapter works perfectly on my build and has moved the viewstate to the bottom of the page on all pages.

Like:

(input type="hidden" name="__SEOVIEWSTATE" id="__SEOVIEWSTATE" ... etc

Cuyahoga is great to work with.
# martijnb 2/24/2009 8:20 AM
Thanks. Really something to consider for the next versions.
# juanwoang 2/27/2009 6:28 PM
Oh, great! Thank u much. I like to add this for mine