Reducing Viewstate for a Repeater Control

Last post 04-24-2006 10:03 AM by SonuKapoor. 3 replies.

Sort Posts:

  • Reducing Viewstate for a Repeater Control

    04-21-2006, 7:20 AM
    • Member
      65 point Member
    • John5
    • Member since 04-20-2006, 3:23 PM
    • Posts 37

    Hello

    I have a repeater control displaying about 2000 records in a grid style

    The problem is the viewstate that this creates is very large

    But I need the itemcommand event to still work, as each row as a 'View details' link

    Is there a way I can reduce the viewstate for the repeater, whilst still letting the Itemcommand event to work?

    Many thanks

     

  • Re: Reducing Viewstate for a Repeater Control

    04-21-2006, 10:26 AM
    • Participant
      1,135 point Participant
    • delorenzodesign
    • Member since 08-24-2005, 7:29 PM
    • Nutley, NJ USA
    • Posts 240
    One suggestion would be to not display 2000 records at once and use some type of paging.

    Can any user actually view 2000 records in a single screen?  Or would they need to?

    Some links of interest:
    http://www.eggheadcafe.com/articles/20040613.asp
    http://west-wind.com/weblog/posts/4560.aspx
    Michael De Lorenzo
    -------------------------------
    www.delorenzodesign.com
  • Re: Reducing Viewstate for a Repeater Control

    04-24-2006, 9:45 AM
    • Member
      65 point Member
    • John5
    • Member since 04-20-2006, 3:23 PM
    • Posts 37

    Hi

    Yes they wanted to see the 2000 records all at once

    I have turned off viewstate for this particular page and implemented a manual postback method

    It works but is a bit more complicated than I wanted it to be

    Thanks for the reply

     

  • Re: Reducing Viewstate for a Repeater Control

    04-24-2006, 10:03 AM
    • Star
      13,171 point Star
    • SonuKapoor
    • Member since 04-11-2004, 8:24 AM
    • Montreal/Canada
    • Posts 2,652
    • TrustedFriends-MVPs

    You could try to disable the viewstate only on the rows in the ItemCreated event:

    If e.Item.ItemType = ListItem.Type.Item or e.Item.ItemType = ListItem.Type.AlternatingItem then
       e.Item.EnableViewState = False
    End if

Page 1 of 1 (4 items)