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 4 of 4

Thread: Disable ViewState

  1. #1
    BCru3 is offline Junior Member
    Join Date
    Apr 2010
    Posts
    18

    Default Disable ViewState

    How would I disable ViewState (EnableViewState="false") on one specific xml.config file that displays a large list of manufacturers?
    Or edit the page directive.

    I tried:

    Code:
    <xsl:value-of select="&lt;%@ Page EnableViewState='False' %&gt;"
    disable-output-escaping="yes" />
    but that doesn't work...


    Thx, _Brian

  2. #2
    Ben-LynxSI is offline Member
    Join Date
    Mar 2010
    Location
    Vancouver, BC, Canada
    Posts
    41

    Default

    I could stand to be corrected, but here's my understanding of this:

    XmlPackages aren't parsed/executed until after the requested ASP.net page has already processed page directives. So writing out a page directive from an XMLPackage is too late to make any effect in this page requests lifecycle. (You might even the output in the source of the page returned to the clients browsers, try it to prove our hypothesis here.)

    But I understand what you need. I found this post while thinking along the same lines myself. For certain pages I imagine you could potentially disable the ViewState within the page rendering engine like "ShowCategory.aspx", but I haven't checked what else is in the viewstate.

    Maybe one of the ASPDNSF staff could comment on what else might be lost by disabling ViewState on certain pages that don't normally post-back?
    Ben Swayne - C#/ASP.net/jQuery/Ajax/SEO
    Lynx System Integrators Ltd.
    Lynx Live Agent - real-time analytics, live chat and sales software for ASPDotNetStorefront
    My Personal Website

  3. #3
    BCru3 is offline Junior Member
    Join Date
    Apr 2010
    Posts
    18

    Default I got it

    I disabled the ViewState (EnableViewState="false") on the
    searchadv.aspx and showmanufacturers.aspx pages.

    That worked for me. Now did disabling the ViewState actually speed the page up?

    That's the real question...

    Thx, _Brian

  4. #4
    Ben-LynxSI is offline Member
    Join Date
    Mar 2010
    Location
    Vancouver, BC, Canada
    Posts
    41

    Default

    It may not have spead up your page rendering time (cpu processing on the server); but it will for sure have saved you and your visitors unnecessary bandwidth which costs money and time.

    You might not notice this on a small site (where your server never reaches 100% load), but for those of us on shared servers or with high traffic the change would be noticeable.

    Its kind of like taking extra junk out of your car trunk becuase it will save you some gas. Your car was never broken before, but you were paying to drive around with extra weight on board. Why pay to carry this around if it serves no purpose?
    - Ben
    Ben Swayne - C#/ASP.net/jQuery/Ajax/SEO
    Lynx System Integrators Ltd.
    Lynx Live Agent - real-time analytics, live chat and sales software for ASPDotNetStorefront
    My Personal Website