Hi All,
I have created a web form that will display the Organisation Chart in Tree form. I have dynamically created Tree View control from code behind.Everything working fine.The problem is when I am exporting TreeView to pdf I am getting te following error
"0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed."
The source code is
UpdateProgress1.Visible =
false;
ImgTopBanner.Visible =
false;
Response.AddHeader(
"content-disposition","attachment;filename=TestPage.pdf");
Response.Cache.SetCacheability(
HttpCacheability.NoCache);
StringWriter sw = newStringWriter();
HtmlTextWriter hw = newHtmlTextWriter(sw);
this.Page.RenderControl(hw);
//TrvPrint.RenderControl(hw);
StringReader sr = newStringReader(sw.ToString());
Document pdfDoc = newDocument(PageSize.A4, 10f, 10f, 100f, 0f);
HTMLWorker htmlparser = newHTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
Please help