LLBLGenProDatatSource - Weird behavior when CacheLocation is set to "ViewState"

Posts   
 
    
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 16-Jan-2008 23:28:08   

Hello,

I use latest versions of LLBL files.

I hope this time i'm right and there is a real bug disappointed ...

It could be a missmatch in the ViewState between AspxGridView and LLBLGen or simply with LLBLGen (it lookslike only with LLBLGen.

I have an AspxGridView control linked to an LLBLGenProDataSource.

When the cache location is set to "Session", everything seems perfect. When the cache location is set to "ViewState", it work the first time but I got weird behavior for all other times.

It looklike everything is mixed up for the second edit and next ones. I can't find the exact behavior.

I sent you 2 videos because it would be hard to explain the behavior by text... The only differences is the property "CacheLocation" of the LLBLGenProDatasource.

Note: that there is also another line changed because of code that is there to ensure to have differents values for all the six rows.

This time... I hope that this is a real bug... (It really looklike it to me !!!)

Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 16-Jan-2008 23:33:16   

Please also note that I set these 2 properties of the AspxGridView (DevExpress) for all my tests :

  • EnableViewState = false
  • EnableRowsCache = false
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39619
Joined: 17-Aug-2003
# Posted on: 17-Jan-2008 09:34:01   

Please enable viewstate for the grid and try again.

Frans Bouma | Lead developer LLBLGen Pro
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 17-Jan-2008 15:25:47   

I tested with the grid EnableState property to true and the results are exactly the same... The grid viewstate does not affect the behavior.

Only LLBLGenProDataSource CacheLocation property set ViewState does that.

AND ...

I just also made another test: the Grid EnableCallbacks set to false. The result is perfect too. I think that EnableCallbacks do use Ajax behind and only send the portion of the grid and probably only the ViewState of the grid. In some way that's why I get the old value when I try to edit a second time the same value of the grid.

Correct me if I'm wrong but as far as I understand I should never mixed and match: Any WebControl with AjaxEnable and LLBLGenProDataSource with CacheLocaltion set to ViewState ???

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39619
Joined: 17-Aug-2003
# Posted on: 18-Jan-2008 10:36:48   

I think you're right. The viewstate contains the state of the control when the page was rendered. This is sent to the user. Then the user alters all kinds of things in the browser and if the browser makes calls to the server to obtain new data etc., it will go wrong as the viewstate IN the browser isn't updated.

So I think you should indeed place the state for these datasource controls in the session, as that's updated when a new call to the server is made.

I can't do a thing about this unfortunately, the viewstate is something in the HTML page for when the page is posted back to the server, but with ajax, that's not going to be the case. So pick Session for these situations.

Frans Bouma | Lead developer LLBLGen Pro
Wally
User
Posts: 285
Joined: 29-Aug-2007
# Posted on: 18-Jan-2008 15:55:17   

Ok thanks !

worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 08-Feb-2008 03:55:07   

This sounds like the same issue I had in another thread. I "fixed" it by setting cache to session (or anything but viewstate).

ASPxGridView uses callbacks, which presumably doesn't update the pages viewstate. Is the llblgendatasources incompatibility with callbacks resolvable? Is it DevExpress's problem? Is this problem seen when using M$ datasource controls?

Walaa avatar
Walaa
Support Team
Posts: 14951
Joined: 21-Aug-2005
# Posted on: 08-Feb-2008 09:39:59   

Is this problem seen when using M$ datasource controls?

It's working like a charm with the MS controls and LLBLGenProDataSource, please check out the ASP.NET 2.0 Databinding example posted in the download section of the LLBLGen site. (There are AJAX solutions)