I have an ASP.Net 4.0 application in which contains a web form containing a ScriptManager, UpdatePanel and some controls, including a WebDropDown. This form has been in production for some time now with no issues. The app is using 2010.3
I recently tried to add another field to the form (textbox), and after compiling and executing the code on my VS2010 PC when I attempt to post the page back I started getting this error:
"Microsoft.JScript" runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed."
I have tried removing my changes to the page, but the error still comes up. I even pulled from the production server the same web form in production (aspx, cs and designer files) and replaced the existing files of my project, but I still get the same error.
Testing other web forms in my application using AJAX, they work fine, so I assumed it must be a problem with the specific form.
So I stripped down my page and left only the WebDropDown and the button causing the postback and tested. The problem occurs with the WebDropDown and goes away without it. I went one step further and left the WebDropDown with no data, and the problem did not occur. Loading some dummy data manually in the code behind (as opposed to data from the db) also results in the problem not happening. So my next assumption was that this is a data related issue (hence why the problem did not happen in production).
To test my theory I downloaded the prod database and used it on my machine; the problem occured, so my theory is wrong.
I am running out of ideas, so please if you have ever encountered such an issue I would appreciate some help.
After many hours of tests I have arrived to the conclusion that the error has to do with the number of records loaded on the WebDropDown; by limiting my stored procedure to the top 999 records, the application is fine. Upon selecting the top 1000 records the error is thrown.
If anyone knows of a setting in the control which might explain this bahavior, please let me know as soon as possible.
thanks
Hello Chris,I have made a sample based on the information you have provided via NetAdvantage 11.2.20112.2025 which is the latest service release for the moment and tested it under IE 9. The sample contains WDD populated on code behind and a button causing postback. The issue is not reproducible via table with 900 or 1900 records. Please modify the sample or create a new one which reproduces the missbehavuior you are facing.
Hi Nikifor
Please find attached a VS2010 project sample I created. You will need to use a datasource.
Nikifor
In trying out this sample, I get another error as well: "Operation is not valid due to the current state of the object."
Thank you all for sharing your experience with the community
The app settings fix also worked for a WebTree with > 1000 check box nodes. I was having the the error below.
Error Message: System.InvalidOperationException: Operation is not valid due to the current state of the object. at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeList(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) at Infragistics.Web.UI.Framework.ObjectBase.LoadCollectionsStateFromViewState() at Infragistics.Web.UI.Framework.RunBot.HandleLoadViewState() at Infragistics.Web.UI.Framework.Data.HierarchicalDataBoundControlMain.LoadViewState(Object savedState) at Infragistics.Web.UI.NavigationControls.NavControl.LoadViewState(Object savedState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.LoadChildViewStateByID(ArrayList childState) at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at Infragistics.Web.UI.LayoutControls.AJAXContentPane.InstantiateTemplate(Boolean ajax, Boolean dynamicUP, String triggerID, Boolean loadContent) at Infragistics.Web.UI.LayoutControls.WebTab.InstantiateTemplates() at Infragistics.Web.UI.LayoutControls.WebTab.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.FindControl(String id, Int32 pathOffset) at System.Web.UI.Control.FindControl(String id, Int32 pathOffset) at System.Web.UI.Page.FindControl(String id) at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
FYI -
In our situation, our main processing page - the one with the most controls and data - started erroring out. After much research we found the problem was related to a Microsoft update. Most references suggested changing the "MaxHttpCollectionKeys" in your appSettings. That didn't correct the problem for our web application.
So...with a little more research I also found a reference concerning the "MaxJsonDeserializerMembers". Once we bumped that value up in appSettings, the error was corrected.
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="5000" />
<add key="aspnet:MaxJsonDeserializerMembers" value="5000" />
</appSettings>
This was caused by Microsoft’s upgrade MS11-100 – specifically KB2656351 and KB2661403.
Hope this helps.
Hello everyone,
This issue is introduced by Microsoft with a recent .NET Framework security update from 12/29/2011. The knowledge base article describing the change is located here: http://support.microsoft.com/kb/2661403 . Microsoft are now limiting the size of the JSON keys collection to 1000 items by default and this can be changed via configuration. This means that when a control like the WebDropDown or the WebDataTree has more than 1000 items, an invalid operation exception would be thrown on deserialization of the view state.
Stackoverflow has several articles about this issue: http://stackoverflow.com/questions/8686129/microsoft-hash-dos-security-update-imposes-1000-form-field-limit-breaks-large-f
You can avoid this issue via configuration by changing the MaxJsonDeserializerMembers to a value larger than the default (1000):
<configuration> <appSettings> <add key="aspnet:MaxJsonDeserializerMembers" value="1000" /> </appSettings> </configuration>
My company has a big investment in Infragistics controls. This is a critical problem for my company. We have production applications falling out of the sky. Our IT department will not roll back the patch on any of our servers. We really need this fixed.
This is not an acceptable answer for our company. We are reviewing other 3rd party controls. The resolution of this issue will weigh heavily on our decision to move other controls offered by other 3rd party companies.
Thanks for your help