Wednesday, March 21, 2012

LoadPageStateFromPersistenceMedium and AJAX Beta 2

Anyone else using Load/Save PageFromPesistenceMedium and AJAX Beta 2. In my functions, I'm saving the state in a compressed format to reduce the size of the viewstate as its passed back and forth over the browser. We are talking around 1 MB of viewstate uncompressed here so it's needed...

Anyway, in previous CTPs of the ATLAS framework, this has all worked fine. In the Beta 2 update, it appears as though the viewstate that is created on inital page view remains around. For example, I have a gridview control that contains a dropdown list in each row for sorting the items in the gridview. You click a new value in the drop down and that row is supposed to move to that row in the grid. With the current Beta 2, if I move row 5 to row 1, that works. Then I select row 5 to move to row 3 and the record in row 1 moves to row 3 instead! (row 1 contains the original row 5 so it seems to reference that row on the server and move it to 3).

I've obviously got to look at my own load/save code here but since the Beta 2 update is the only change, I'm starting with something being broken in that. Let me know if you've got any other thoughts?

Thanks.

I use compressed state myself, but again, I use only UpdatePanel.

I have implemented my own PageStatePersister / IStateFormatter instead though. I feel that this is a more proper way than overriding the method in the actual page.

Have you tried without overriding state load / save ?


If I don't use the save/load of state, everything works fine except i have a very large viewstate object being passed around.

I've found one workaround right now. The viewstate can be saved to the server as a temp file instead of going back down to the server. This appears to work so for the time being, I can use this and just have a clean up on application_end to remove the viewstate files. However, this makes me believe that the hidden input values aren't being updated properly in this beta 2.


Try to implement what I mentioned!

 
public class CompressedHiddenPageStatePersister : HiddenFieldPageStatePersisterpublic class CompressedStateFormatter : IStateFormatter

I recommend you to look at these (not garantueed to help though)

You could also just try to compress the whole thing itself, withASPX compression in IIS

No comments:

Post a Comment