Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello friends,

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 am getting this error when i am saving to database.
Posted
Comments
LittleYellowBird 26-Jul-11 4:32am    
Hi, you haven't really asked a question here or given any context, I don't think anyone can help you much until you do. Best Regards, Ali
Sergey Alexandrovich Kryukov 26-Jul-11 11:49am    
Agree. Not enough information.
--SA

If I understood you correctly, it is an UpdatePanel problem in your page, here is the solution set EnablePartialRendering to false in the ScriptManager

I think it may help somebody
 
Share this answer
 
v2
Please first check your Asp.Net Ajax Extension and Ajax ControlToolkit (if been used) ' s version. Update to the latest.If not, you should check your settings such as web.config and your C# code.

By the way , based on the error description, it looks mostly like some setting errors.

12031 ERROR_INTERNET_CONNECTION_RESET
The connection with the server has been reset.

If your problem cannot been resolved , please share more code.
 
Share this answer
 
v2
If you're getting that from an updatePanel, set EnablePartialRendering="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!

Thanks
 
Share this answer
 
v2
I have seen this error occur when a button is clicked from within an UpdatePanel and the session has timed out. You can trap this error by adding a javascript error handler.

JavaScript
//catch timeout error
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            if (args.get_error() != undefined) {
                var errorMessage;
                var error = args.get_error;
                if (args.get_response().get_statusCode() == '12031') {    //ERROR_INTERNET_CONNECTION_RESET
                    errorMessage = "Session Timeout.";
                }
                else if (args.get_response().get_statusCode() == '200') {
                    errorMessage = args.get_error().message;
                }
                else {
                    errorMessage = 'An unspecified error occurred. ';
                }
                args.set_errorHandled(true);
                alert("An error occurred: " + errorMessage + " Please refresh the page to restart your session.");
               // window.location.reload();  //refresh to re-login
            }
        }


Hope it helps!!
Thanks
 
Share this answer
 
v2
Comments
Karan Sehgal 47 31-Jul-17 23:55pm    
I Have already written the above code. our client is getting time out error but we are not able to re-produce. As per log or alert he is getting timeout error. Ideally it should not because i have set max time out is 1 hour.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900