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. Advertising

  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. Advertising

  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. Advertising

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. H.G.Srivatsa

    string vs stringbuilder

    H.G.Srivatsa, Aug 12, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    17,026
    Richard Grimes [MVP]
    Aug 25, 2005
  2. =?Utf-8?B?SGFuZGk=?=

    no stringbuilder in C#2.0?

    =?Utf-8?B?SGFuZGk=?=, Sep 11, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    988
    =?Utf-8?B?SGFuZGk=?=
    Sep 11, 2004
  3. ESPN Lover

    How to reset a StringBuilder?

    ESPN Lover, Oct 13, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    6,940
    ESPN Lover
    Oct 14, 2004
  4. =?Utf-8?B?SnVzdGlu?=

    Double Quotes in a stringbuilder

    =?Utf-8?B?SnVzdGlu?=, Mar 17, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    7,852
    Mythran
    Mar 18, 2005
  5. Roedy Green
    Replies:
    11
    Views:
    907
Loading...

Share This Page