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

Sys.WebForms.PageRequestManagerParserErrorException

1 Answer 496 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Blop
Top achievements
Rank 1
Blop asked on 13 Jul 2012, 07:51 AM
Hello,
I keep having this error with a radgrid (ajaxified with a RadAjaxManager) : Uncaught Sys.WebForms.PageRequestManagerParserErrorException: 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 '%PDF-1.4 

On the Radgrid I ve a button to open / generate a pdf coming from a database. I know the issue is coming from the Response.(), to open the pdf I ve to do something like that: 

Response.Clear()
Response.ContentType = "application/pdf"
Response.AddHeader("Content-Disposition", "attachment; filename=MyPdfFile.pdf")
Response.BinaryWrite(binaryFieldPdf.ToArray)
Response.End()

How could I avoid this error using ajax and still have a Response() in my function?       

1 Answer, 1 is accepted

Sort by
0
Saravana Kumar
Top achievements
Rank 1
answered on 19 Jul 2012, 06:50 AM
You Have To add a PostBack Trigger For the Button .

For Example:

<Triggers>
                <asp:PostBackTrigger ControlID="button1" />
            </Triggers>

Tags
Ajax
Asked by
Blop
Top achievements
Rank 1
Answers by
Saravana Kumar
Top achievements
Rank 1
Share this question
or