i did ,exporting gridview to pdf, it working well , but i need to export plain textboxes instead of gridview
here is code i changed
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
//GridView1.AllowPaging = false;
//GridView1.DataBind();
//GridView1.RenderControl(hw);
TextBox1.Text = "SATHEESH KUMAR AVULA";
TextBox1.DataBind();
TextBox1.Visible = true;
TextBox1.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
First it was given me Error :-
RegisterForEventValidation can only be called during Render();
I solved it by making
EnableEventValidation="false"
Than Second Error:-
The document has no pages.
pls give some solution for that am really stuck for long days , my destination is i want to download whole Membership form in pdf format how can i ??????
thanks