I was looking at the source code for a typical product page and noticed that one of the first things inside the body tag was this VIEWSTATE Id tag that's a like a mile long. I need to move that to the bottom of the body tag if that won't cause any issues. I'm assuming this is in the product.aspx page some place.
Will this cause any issues? Can I move those other javascript tags to the bottom too?
Moving the viewstate Id
Re: Moving the viewstate Id
I think you are are viewing the HTML source in browser, are you?
VIEWSTATE is handled by ASP.NET and you must never change it and simlarly most of the javascript is emitted by ASP.NET controls. Any how changing this can cause undesirable results so better avoid it
VIEWSTATE is handled by ASP.NET and you must never change it and simlarly most of the javascript is emitted by ASP.NET controls. Any how changing this can cause undesirable results so better avoid it
Re: Moving the viewstate Id
don't want to change it.
I just want to move it. The lower it is, the higher my relevant content is. Google likes this.
Moving it would cause a problem?
I just want to move it. The lower it is, the higher my relevant content is. Google likes this.
Moving it would cause a problem?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Moving the viewstate Id
If it can't be moved- I think .net just generates it-- you might want to do something like the following for meta tags. I did this and put my Description in the META description, and that is what Google is picking up to show in the summaries for the links.
viewtopic.php?f=42&t=7489
viewtopic.php?f=42&t=7489
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Moving the viewstate Id
It can be moved to the bottom of the page. Search Google for "HttpModule ViewState" and you will find several. A few years ago I even wrote one.
Unfortunately, moving viewstate to the bottom of the page has a side effect. As you noticed, the viewstate element can be quite big. If you move it to the bottom, the browser might render the top of the page before the viewstate element is rendered. If the top of the page includes an element that causes a postback and if the person at the other end of the line clicks on that element before the viewstate is loaded, then the viewstate in the postback will not match the viewstate that the server sent and ASP.NET will throw an exception.
This happens more frequently than you might imagine. After several invalid viewstate exceptions, I decided to leave viewstate at the top of the page.
Unfortunately, moving viewstate to the bottom of the page has a side effect. As you noticed, the viewstate element can be quite big. If you move it to the bottom, the browser might render the top of the page before the viewstate element is rendered. If the top of the page includes an element that causes a postback and if the person at the other end of the line clicks on that element before the viewstate is loaded, then the viewstate in the postback will not match the viewstate that the server sent and ASP.NET will throw an exception.
This happens more frequently than you might imagine. After several invalid viewstate exceptions, I decided to leave viewstate at the top of the page.
Re: Moving the viewstate Id
As a followup, the .NET Framework 3.5 Service Pack 1 includes a new setting to force all of the hidden fields to the top of the form (prior to this ViewState was at the top, but EventValidation was near the bottom I think).
MS added the option to fix the validation error that occurs if a postback is made before the page fully rendered.
See "Update for viewstate issues" on the ASP.NET Debugging blog.
MS added the option to fix the validation error that occurs if a postback is made before the page fully rendered.
See "Update for viewstate issues" on the ASP.NET Debugging blog.
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: Moving the viewstate Id
Our AbleCommercePage base class includes such this code but it is deactivated. It causes problems as discussed above.afm wrote:It can be moved to the bottom of the page. Search Google for "HttpModule ViewState" and you will find several.
I have to believe that major search engines are aware of the problem and would (at some point) factor this into their ranking logic.
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.