Forum:  LLBLGen Pro Runtime Framework

Thread:  Does the LLBLGenProDataSource2 *need* ViewState?

MattWoberts (User)   Posted on: 24-Sep-2007 11:48:00.

I'm working on a page which is creating quite a lot of viewstate, thus making the file size pretty big. It uses a repeater to repeate a user control a number of times (about 10). Inside the user control an LLBLGenProDataSource2 object is used to get the data for a grid - all works fine.

The file size for this page with a little data is 181K.

Howerver, if I modify the LLBLGenProDataSource to set EnableViewState = false, then the file size drops to a whopping 69K, but it stops working! When I save a grid's data, nothing is updated in the database.

Do I have to use the viewstate? What exactly is is storing in there - thats quite a lot of data!

I can confirm that the PerformWork method isn't firing when viewstate is set off. I wonder if I need to re-wire this up in the page load to make it start working...

Nope, the PerformWork just wont fire without viewstate, this is a major problem for me! I hope Frans is reading Wink
MattWoberts (User)   Posted on: 24-Sep-2007 12:29:35.
Aha, just re-read the docs:

The LLBLGenProDataSource2 control contains a data containing object, be it an entity collection, TypedList or TypedView. This data is cached in-between postbacks, until the data has to be refreshed. The place where this data is cached is either in the viewstate, ASP.NET cache or the session

Sheesh, I apologise for posting before being 100% sure the info was not in the docs!

Otis (LLBLGen Pro Team)   Posted on: 24-Sep-2007 12:31:25.
To be able to perform 2-way databinding, the original data has to be stored somewhere. Regular Smiley So you can pick your poison where to store it. Regular Smiley