Click here to Skip to main content
11,496,146 members (341 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: C#3.0
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 25-Jul-11 23:01pm
Alison P at 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
SAKryukov at 26-Jul-11 11:49am
Agree. Not enough information.
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
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.

The connection with the server has been reset.

If your problem cannot been resolved , please share more code.
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!

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.

//catch timeout error
        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. ';
                alert("An error occurred: " + errorMessage + " Please refresh the page to restart your session.");
               // window.location.reload();  //refresh to re-login

Hope it helps!!

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600

Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 7 Jun 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100