I get this error when the below function runs from within an Updatepanel:
"Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed"
VB.NET:
[FONT="Courier New"]Function CreatePDF(ByVal path As String)
Response.Clear()
Response.AppendHeader("content-disposition", "attachment; filename=sample.pdf")
Response.ContentType = "application/pdf"
Dim doc As New Document
pdf.PdfWriter.GetInstance(doc, Response.OutputStream)
doc.Open()
Dim img As Image = Image.GetInstance(path)
'img.Alignment = Image.ALIGN_CENTER
img.ScalePercent(20)
doc.Add(img)
doc.Close()[/FONT]