views:

11565

answers:

5

I'm occasionaly getting the following popup from an AJAX.NET application

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

From the Microsoft kb that status code indicates a ERROR_INTERNET_CONNECTION_RESET, but it doesn't state what was the underlying issue the triggered the error in the first place.

How can I log/trace/etc the underlying error that generated the popup?

+6  A: 

If you're getting that from an updatePanel, set EnablePartialRendering to false in the ScriptManager for the page, and then it should give you the actual error.

Also, if it only happens occasionally, I've found that it could be a viewstate problem, especially when the page goes a long time (20mins or so) between refreshes.

Otherwise, try some try/catch blocks. Those are some easy methods.

Hope that helps!

Zachary Yates
"set EnablePartialRendering to false" helped me find the error, thanks!
Homer
Helped me too, thanks!
Biff MaGriff
+1  A: 

It's a viewstate problem, but not related with time but with size. Try playing with maxRequestLength in your web.config.

penyaskito
Thanks for pointing me in the right direction. I was finally able to fix the problem by writing the ViewState to the DB, instead of sending it in the page to the browser.
A: 

I had the same problem and Zachary's answer helped me get to the cause of the problem. Thank's Zak!

Bob Jones

Bob Jones
Please use the comments system and voting to show your support for another answer.
Chris Porter
A: 

sometimes the error occurs if you have added a server SSL certificate(https).If the certificate is not valid it will give this error.

alice7
A: 

Zachary Yates I am getting same error and following matches: Also, if it only happens occasionally, I've found that it could be a viewstate problem, especially when the page goes a long time (20mins or so) between refreshes.

But you have not mentioned solution for this.

Piyush