Thursday, September 19, 2013

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12031




Recently I came across the following issue when I am clicking on any of the button in the page which needs to pull the data from the server.

Error: Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12031

I googled it a lot and finally found the following as the right solution. Before going to resolve we should know what it means of each and every code. The following link gives you some idea on these.

Reason:  This issue is occurred because of the data placed in the memory is huge means larger than the default memory 4mb (4096 KB). Since the data is exceeded the max length it is unable to place the request or unable to reach the server and hence getting the above error. 

Fix: To resolve the issue we have two scenarios. First increase request length from default to how much you want. For that you have add the specification in web.config.
<httpRuntime maxRequestLength="7168"/> 
For my scenario I feel 7mb is good enough. 
Second is reduce the data placing in the view state.