Currently I have some very big pages (thanks to the viewstate), so I tried to compress the viewstate which is working perfectly. However, when I enable paging on the WebDataGrid and click on a page number, a javascript error is thrown because the control is reading something (in javascript!) from the viewstate.
So my question is: why are you reading from the viewstate client-side? And is there anything I can do to compress my viewstate and still use paging?
Thank you for reporting this. I will correct it in the js file right away. The fix should be available with the next hot fix release.
See the code below. The exception is caught in the line: document.getElementById("__VIEWSTATE").value = obj[0]; (Since the viewstate is null, the value can't be obtained).
$IG.CallbackRequestHandler = function(manager, callbackObject, async){ /// <summary> /// Handles a CallbackObject's request and resposne. /// </summary> var me = this; this._callbackObject = callbackObject; this._manager = manager; this._async = async; this._responseComplete = function() { if (me._request.readyState === 4 && me._request.status == "200") { window.clearTimeout(me._timerId); var response = me._request.responseText; if (response != null && response.length > 0) { var obj = Sys.Serialization.JavaScriptSerializer.deserialize(response) document.getElementById("__VIEWSTATE").value = obj[0]; var eventValidation = document.getElementById("__EVENTVALIDATION"); if (eventValidation) eventValidation.value = obj[1]; me._manager._requestCompleted(me, me._callbackObject, obj[2]); for (var i in obj[3]) { var item = obj[3][i]; if (typeof item != 'object') continue; var id = item[0]; var ctrlObj = $find(id); if (ctrlObj && ctrlObj.dispose) ctrlObj.dispose(); if (item[1]) var x = eval(item[1]); } } else { me._timedOut(); } me._callbackObject = null; me._manager = null; me._request = null; } else if (me._request.readyState === 4) me._manager._requestFailed(me, me._callbackObject); }}
Hello Pieter,
In the ajax scenario it collects the view state to be posted back to the server so the state is restored to whatever it was in the last page life cycle.
Can you post java script error details?
Thanks.