I would like to print a page as PDF. But the thing is that before printing, I want to expand all the controls (GridView, Treeview...).
I found somes solutions using Page.RenderControl (or Control.RenderControl) but i have some error saying "A page can have only one server-side Form tag.". I understand the error (that only one Form must be added). but I would have thought RenderControl would write in the new Writer (and not the current one).
Dim stringWriter As New StringWriter()
Dim htmlWriter As New HtmlTextWriter(stringWriter)
Me.Page.RenderControl(htmlWriter)
To expand controls, I have to change properties and then, render the page. Once rendered in a PDF, I would like to let the page load as normal. Response.End stop loading and the page is blank.
Is there an (good) alternative to take page content, change content (ex: grid.AllowPaging = False) and send him in a stream?