Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: move _viewstate to bottom of page

  1. #1
    netprocity is offline Member
    Join Date
    Dec 2008
    Posts
    80

    Default move _viewstate to bottom of page

    Hello,

    We are trying to compete with some very keyword friendly competitors, and I can see our product pages are loaded with _viewstate information. I want to move this to the bottom of the page. It seems Google only loads a certain amount of data, and I assume that this hurts our page for load time (which also affects our seo rankings).

    Is there a way to move this to the bottom of the page or remove altogether from the page? Here is the example page::

    http://www.soccerstop.com/p-2137-nik...por-vi-fg.aspx

  2. #2
    netprocity is offline Member
    Join Date
    Dec 2008
    Posts
    80

    Default

    I have found a simple way to get rid of all the _viewstate information that is making my page very large by disabling it on the template.master page.

    I just put:::

    <%@ Master Language="C#" EnableViewState="false" AutoEventWireup="true" Inherits="AspDotNetStorefront.MasterPageBase" %>


    My question is if this viewstate information is necessary on any pages? It doesn't seem to effect anything (that I have found).

    Thanks
    James

  3. #3
    netprocity is offline Member
    Join Date
    Dec 2008
    Posts
    80

    Default

    ok, I found the _viewstate is necessary on the page as everything works fine until you get to the payment checkout page. At that point it is needed or the page will not work.

    So how can I get the _viewstate information to go to the bottom of the page? It is taking up space at the top of the code which I want to reserve for more important search engine data.

    Thanks
    James

  4. #4
    netprocity is offline Member
    Join Date
    Dec 2008
    Posts
    80

    Default

    ok, I have figured a solution. What the solution does is remove the _viewstate information from the homepage, all category pages, and product pages, but leaves it on all checkout and topic pages. This way those important paqes load faster and get better organic search results without any problems during the checkout process. I don't know if anyone cares, but for our website our _viewstate was huge because of the large menu system we utilize and was slowing pages.

    Here are the steps:

    1. Create a copy of your template.master page and name it homepage.master.
    2. On your new homepage.master file go into the code and change the top line to include the EnableViewState="false":
    Code:
    <%@ Master Language="C#" AutoEventWireup="true" EnableViewState="false" Inherits="AspDotNetStorefront.MasterPageBase" %>
    3. Go into administration of aspdnsf, go into appconfig paramaters and search for the app: TemplateSwitching.Enabled and change it to "true".
    4. In appconfig paramaters search for the app: HomeTemplate and change the value to "homepage.master" or whatever you called the template file in step 1 above. This will enable your homepage to use the new template that does not have any _viewstate info in it.
    5. Click in administration to "manage categories", and edit all of your top level categories as follows: click to edit category, then click on the extension data tab. In the "use skin template" text input box put "homepage.master" or whatever you called your template in step 1 above. Do this for all top level categories. This will make all of your category pages have the _viewstate information removed, as well as any products inside of them.

    That's it. That will use the new template that has the _viewstate removed on your homepage and all category and product pages. Any other pages in the system will still have the _viewstate info and will work properly.

    Thanks
    James
    Last edited by netprocity; 03-24-2011 at 12:43 PM. Reason: misspelled

  5. #5
    Effortless is offline Junior Member
    Join Date
    Oct 2011
    Posts
    6

    Default

    Hi,

    We are also experiencing huge viewstate. Do you still use this method and if so which version of ASPDNSF are you using?

    Looking at the source of the link you posted there is still a very small amount of viewstate data - did you find another way to reduce it or is this a symptom of the above?

    Cheers

    Steve