Does a StringBuilder effect Viewstate variable size?

Discussion in 'ASP .Net' started by darrel, Jan 28, 2005.

  1. darrel

    darrel Guest

    I have a page that hits a database, and then builds a table on the
    codebehind size using a string builder.

    It's a hefty, complex table. As such, it's a bit large...however, I was a
    bit shocked to find that it was a 1.2mb HTML file. I was even more surprised
    to find the well over half of the page's markup is the viewstate field's
    value. Why is it so [explitive] huge on this page?

    For this page, I think I can just turn it off, as there really isn't a need
    for the viewstate on this page.

    However, I'm going to be building a very similiar table via a usercontrol on
    another site. This site needs to preserve the viewstate for a variety of
    other things going on with the parent page. Is there a way to turn off just
    the usercontron's 'contributeion' to the viewstate value?

    -Darrel
     
    darrel, Jan 28, 2005
    #1
    1. Advertisements

  2. darrel

    darrel Guest

    > Why is it so [explitive] huge on this page?

    OK, I think I know the answer to that one already. It appears that, indeed,
    the entire literal that's holding the string *is* kept in the viewstate
    value. I certainly don't need (nor want this) as this page, itself, has no
    need to postback on itself, so I'll just shut if off for this page.

    And a bit of googling resolved my second issue...you can, indeed, turn of
    viewstate down to the control-level. Nice!

    -Darrel
     
    darrel, Jan 28, 2005
    #2
    1. Advertisements

  3. re:
    > "And a bit of googling resolved my issue..."


    Those words should be engraved, in large letters,
    on every developer's monitor.

    :)



    Juan T. Llibre
    ASP.NET MVP
    ===========
    "darrel" <> wrote in message
    news:%232i%...
    >> Why is it so [explitive] huge on this page?

    >
    > OK, I think I know the answer to that one already. It appears that,
    > indeed,
    > the entire literal that's holding the string *is* kept in the viewstate
    > value. I certainly don't need (nor want this) as this page, itself, has no
    > need to postback on itself, so I'll just shut if off for this page.
    >
    > And a bit of googling resolved my second issue...you can, indeed, turn of
    > viewstate down to the control-level. Nice!
    >
    > -Darrel
    >
    >
     
    Juan T. Llibre, Jan 28, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arpan
    Replies:
    2
    Views:
    28,036
    Johann MacDonagh
    Dec 4, 2004
  2. Dr. Colombes
    Replies:
    1
    Views:
    1,272
    John Hunter
    Feb 10, 2005
  3. bobby

    header file size effect

    bobby, Feb 19, 2008, in forum: C Programming
    Replies:
    7
    Views:
    406
    J. J. Farrell
    Feb 19, 2008
  4. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    13,468
    Michael Jung
    May 25, 2008
  5. Roedy Green
    Replies:
    11
    Views:
    1,043
  6. Pallav singh
    Replies:
    2
    Views:
    412
    Bo Persson
    Apr 7, 2009
  7. Jim S.

    effect of variable

    Jim S., Apr 19, 2011, in forum: Ruby
    Replies:
    3
    Views:
    188
    Jim S.
    Apr 20, 2011
  8. Jens Thoms Toerring

    Re: why does thie variable length size spec compiles

    Jens Thoms Toerring, Sep 7, 2013, in forum: C Programming
    Replies:
    3
    Views:
    346
    Malcolm McLean
    Sep 7, 2013
Loading...