Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed
I fixed this issue. As I'm using UpdatePanel
, I added below code in the Page_Load
event of the page and it worked for me:
protected void Page_Load(object sender, EventArgs e) {
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
scriptManager.RegisterPostBackControl(this.btnExcelExport);
//Further code goes here....
}
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed - Link Button within Gridview
The problem is that those controls are in a template so you cannot reference them directly. Use the RowDataBound event and assign the buttons a trigger programatically.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//check if the row is a datarow and not the first row
if (e.Row.RowType == DataControlRowType.DataRow)
{
//find the button with findcontrol
LinkButton lb = e.Row.FindControl("lnkLogFiles") as LinkButton;
//assign the button as a postback trigger
ScriptManager.GetCurrent(Page).RegisterPostBackControl(lb);
}
}
ASP.NET Ajax Error: Sys.WebForms.PageRequestManagerParserErrorException
There is an excellent blog entry by Eilon Lipton. It contains of lot of tips on how to avoid this error:
Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it
Read the comments too. There is a comment of somebody with the same problem: "I solved it changing server idle time of my app pool on IIS. It was only 5, so I incremented it and now works."
"The UpdatePanel control uses asynchronous postbacks to control which parts of the page get rendered. It does this using a whole bunch of JavaScript on the client and a whole bunch of C# on the server.
Asynchronous postbacks are exactly the same as regular postbacks except for one important thing: the rendering. Asynchronous postbacks go through the same life cycles events as regular pages (this is a question I get asked often).
Only at the render phase do things get different. We capture the rendering of only the UpdatePanels that we care about and send it down to the client using a special format. In addition, we send out some other pieces of information, such as the page title, hidden form values, the form action URL, and lists of scripts."
Most common reasons for that error:
- Calls to Response.Write():
- Response filters
- HttpModules
- Server trace is enabled
- Calls to Server.Transfer()
Sys.WebForms.PageRequestManagerParserErrorException
this working fine for me because the button is include Telerik grid
I add the following :
<Triggers>
<asp:PostBackTrigger ControlID="gvAllDocuments" />
</Triggers>
How to fix error: The message received from the server could not be parsed
The action that causes this code to execute MUST be a postback event, and not an AJAX call.
This is due to the nature of the way AJAX requests are processed.
Error: Sys.WebForms.PageRequestManagerparserErrorException: The message received from the server could not be parsed
Finally, i found the solution. Nothing given in online blogs matched to my issues, problem was from database side.
Tahnks..!!
Related Topics
Controlling Execution Order of Unit Tests in Visual Studio
How to Display the Displayattribute.Description Attribute Value
Get Number of Listeners, Clients Connected to Signalr Hub
Generating .Net Crash Dumps Automatically
Async Implementation of Ivalueconverter
Set Cultureinfo in ASP.NET Core to Have a . as Currencydecimalseparator Instead of ,
How to Use a Controller in Another Assembly in ASP.NET Core MVC 2.0
Who Should Call Dispose on Idisposable Objects When Passed into Another Object
Button Inside a Winforms Textbox
Why Is It Impossible to Override a Getter-Only Property and Add a Setter
Namespace and Class with the Same Name
How Do Closures Work Behind the Scenes? (C#)
How to Find One Image Inside of Another
Only Parameterless Constructors and Initializers Are Supported in Linq to Entities
How to Initialize a C# Attribute with an Array or Other Variable Number of Arguments