Forum Moderators: open

Message Too Old, No Replies

Problems with the ASP.NET VIEWSTATE

ASP.NET VIEWSTATE causing SEO issues?

         

Cluttermeleon

4:28 pm on Dec 18, 2006 (gmt 0)

10+ Year Member



Hi, My site has been written in ASP.NET and as such has a hidden input field with the id "__VIEWSTATE". As the user goes through the site this string becomes longer and longer and when I look in the page source the most important part, the content, is underneath all this unwanted code.

Does anybody know whether this is a big concern from an SEO point of view and if it is, is there is a tried and tested solution to this problem.

Thanks in advance for any help.

pageoneresults

5:02 pm on Dec 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Does anybody know whether this is a big concern from an SEO point of view and if it is, is there is a tried and tested solution to this problem.

I'm glad you brought this topic up. I was about ready to myself.

I'm concerned. Why? Because I've seen pages with 1,000+ lines of viewstate code. And, I've not been able to find those pages in the first 100 results of searches that the pages should be ranking for.

There is a way to prevent all of that viewstate stuff from showing and also to optimize the ASP.NET code output a bit more than what it does out of the box.

The other thing that disturbs me with ASP.NET is the practice of wrapping an entire page in <form></form>.

I'm very impressed with the functionality that ASP.NET provides. What I'm not impressed with is the tag soup that is generated by some ASP.NET developers (worse than FrontPage). You know who you are, I'm sending you a link to this topic! ;)

Previous WebmasterWorld Topics on ViewState
[google.com...]

Ocean10000

7:07 pm on Dec 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Some nice reference links

Describes how and why viewstate works the way it does.
TRULY Understanding ViewState [weblogs.asp.net]

For those who have large viewstates and ran out of ways to reduce it further, always an option to compress the contents of viewstate saved to the page, reducing bandwidth costs on downloads & postback events.
Code Project: ViewState Compression [codeproject.com]

I can't find the other link I wanted showing how to move the viewstate link to the bottom of the form listings instead of the top, which would help for SEO purposes. I found it on CodeProject in 2003, but my link no longer works.

The basic premise is take the encoded viewstate string and split it into multple smaller hidden fields, this helps with some filters/proxies that trip up over large hidden fields. These smaller hidden input which are inserted at the bottom but still inside of the form. I use this method along with the compression to a great effect. This is all done before the render event, so no ugly regex's to maintain.