This is a migrated thread and some comments may be shown as answers.

Yet another PageRequestManagerParserErrorException crash

1 Answer 751 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 24 Feb 2017, 04:38 PM

I wrote a Telerik Ajax based app that has been in use for years.  Among other things it has a RadGrid that displays links to files stored in a SQL db.  If a user wants to download a file, they simply click on the link and it downloads. (The files are stored in SQL Server db fields.)  The c# code itself is fairly vanilla, something I cook-booked off the web. The data is fed into a byte array (bytes) and then passed to this final section.  (I've traced and verified that the data is coming from the db as usual.)  As I said, it's been in use for years without problems.

                    HttpContext.Current.Response.Clear();
                    HttpContext.Current.Response.Buffer = true;
                    HttpContext.Current.Response.Charset = "";
                    Response.Cache.SetCacheability(HttpCacheability.NoCache);
                    HttpContext.Current.Response.ContentType = sAttachType;
                    sAttachName = sAttachName.Replace(" ", "%20");
                    HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=\"" + sAttachName + "\"");
                    HttpContext.Current.Response.BinaryWrite(bytes);
                    HttpContext.Current.Response.Flush();                                   
                    HttpContext.Current.Response.End();

 

Now that I've upgraded to the latest Telerik controls and moved development to VS2015 in a Windows 8 virtual machine, this has started.

Telerik.Web.UI.WebResource.axd:9 Uncaught Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'PK!���V�'.
    at Function.f.create (Telerik.Web.UI.WebResource.axd:3)
    at Sys.WebForms.PageRequestManager._createPageRequestManagerParserError (Telerik.Web.UI.WebResource.axd:9)
    at Sys.WebForms.PageRequestManager._parseDelta (Telerik.Web.UI.WebResource.axd:9)
    at Sys.WebForms.PageRequestManager._onFormSubmitCompleted (Telerik.Web.UI.WebResource.axd:9)
    at Array.<anonymous> (Telerik.Web.UI.WebResource.axd:3)
    at Telerik.Web.UI.WebResource.axd:3
    at i (Telerik.Web.UI.WebResource.axd:3)
    at t.Net.WebRequest.completed (Telerik.Web.UI.WebResource.axd:3)
    at XMLHttpRequest._onReadyStateChange (Telerik.Web.UI.WebResource.axd:3)

I can see there are numerous references to this problem online but nothing I've seen so far seems relevant.  (I've upped my maxRequestLength to 5 meg.  There is no Asp.Net update panel in my system.  Etc.. )  

My copy of the Telerik controls is most definitely licensed (another reference I've seen), but feel free to remind me how to double-check that. 

Suggestions?

 

 

1 Answer, 1 is accepted

Sort by
0
Jeff Shaw
Top achievements
Rank 1
answered on 31 May 2018, 05:53 PM
I have been looking into the very same situation. I discovered that my control that the user clicks on to open up the document (from a database) was inside of an Ajax Update Panel. When I removed the update panel, the document opened as expected.
Tags
Ajax
Asked by
Boris
Top achievements
Rank 1
Answers by
Jeff Shaw
Top achievements
Rank 1
Share this question
or