Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: The status code returned from the server was: 500

13,107

Solution 1

For those who may encounter with the same problem and suffer from it.

For the idea to solve the problem check ValidateRequest page directive. Well that is where I get the information about innerHTML-inner Text and HTMLEncode-HTMLDecode thing. Then I used Server.HtmlEncode(); for every textboxes I have on that webpage.An example

UrunNoTextBox.Text = Server.HtmlEncode("");

Solution 2

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

Solution 3

This issue comes when you have a control registered as an AsyncPostbackTrigger in multiple update panels.

Try adding the following right after the script manager declaration:

<script type="text/javascript" language="javascript">

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

     function EndRequestHandler(sender, args){

        if (args.get_error() != undefined){

            args.set_errorHandled(true);

        }

    }

</script>
Share:
13,107
Bastardo
Author by

Bastardo

Dr. Destiny: You don't have any special powers! Batman: Oh, I have one, Johnny. I never give up. Justice League - Only A Dream I wanna be the very best Like no one ever was To catch them is my real test To train them is my cause I'm not a person who particularly had heros when growing up. Dennis Ritchie The best way to predict the future is to invent it. Alan Curtis Kay You should trust your gut more than any metrics. Build it, and they will come. Jeff Atwood If you think it's simple, then you have misunderstood the problem. Bjarne Stroustrup Stay hungry, stay foolish. Steve JOBS My reputation grows with every failure. George Shaw Four steps to achievement: Plan purposefully. Prepare prayerfully. Proceed positively. Pursue persistently. William Arthur Ward

Updated on June 04, 2022

Comments

  • Bastardo
    Bastardo almost 2 years

    My error is

    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: 500

    I have an UpdatePanel, and a GridView in it, and several TextBoxes on my webpage.In my gridview there are product informations, when I set the SelectedIndex of my gridview as -1 for the start.

    I run the code, and select a product from the gridview, it works fine.Then I click to another product on the gridview(meaning the selected index is changed) then I get the error at the top of my question.

    A day ago, Infragistics tabs were used in this webpage for Tabs, this error wasn't appearing, I am using Ajax TabContainer now but I can't seem to handle this error.I tried adding ValidateRequest="false" to my Page directive but that didn't work out.

    Any ideas?Anybody encountered with this kind of error and solved?

    Thank you in advance.