ne way to optimize the use the VIEWSTATE property for
pages you develop with the page and controls where
ASP.NET is to keep a check necessary so that the size of the
on the view state of the page and value for the hidden field of
the controls that are added to _VIEWSTATE is minimum. This will
the page. Any seasoned developer ensure that your page loads fast
of ASP.NET will remember the and that the search engines can
VIEWSTATE which is added to every retrieve the actual content of
page in a hidden field _VIEWSTATE your page.
and contains base64 encoded data
which could be any where from 800 Some search engines only read a
to tens of thousands of certain set of characters from
characters long depending on your the top (that's why you have most
usage of this property on your SEO specialists mentioning that
page. you should have your keywords on
the top of the page) and the
There are many issues with view bottom of the page. If the value
state in ASP.NET 1.x. It is on by of the hidden field of _VIEWSTATE
default, and unless you know to is long on your page then these
look for it and disable it when search engines would not be able
it is not needed, it can to get to the actual content of
significantly increase the amount your page as a result it would
of data rendered by your page. never map the keywords (keywords
This becomes particularly painful density) and you would have a low
when you use data-bound controls, ranking on these search engines.
all of which use view state to
save their state across post How to decrease the size of the
backs. view state?
You need to ensure that you only a. As mentioned before the
VIEWSTATE for any page is set to You will see a considerable
TRUE by default. If you do not difference in the page size and
require the controls or the page the loading time of the page once
to hold the VIEWSTATE you can you disable the VIEWSTATE of the
disable the VIEWSTATE for the controls or the page. This will
page completely by adding the also be evident from the size of
directive to the page. (Usually the base64-encoded string in the
if you have a page that does not value field of the hidden field
post back to itself you can of _VIEWSTATE. By disabling the
disable the VIEWSTATE on these VIEWSTATE for a couple of
pages.) datagrid controls on one of the
pages of our clients website, we
b. You can selectively disable were able to reduce the VIEWSTATE
the VIEWSTATE of the controls, of the page from 10,000
datagrids etc that you use on the characters to 1000 characters and
page if these controls do not the page size also reduced by a
post back to the same page. few kilobytes (KB).
About the Author:
Manoj Mansukhani is the founder and CEO of Scarlet Technologies (http://www.scarlettech.com). They provide services to help business get setup and succeed online. Their services include online marketing, search engine optimization, increasing website conversion rates and web development. Visit the website to find out how you can succeed online.
Read more articles by:
Manoj Mansukhani
Article Source: www.iSnare.com