How to print a part of the webform?
I need to print a part of webform, when the user clicks on a print button. How to do that? Should i use reports? or directly from the webform itself it can be printed?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Krishna GaradRank #191 · 12.8K reputationPosted Jun 22, 2011, 9:57 PM EDT
protected void btnprint_Click(object sender, EventArgs e)
{
btnprint.Visible = false;
Session["ctrl"] = Panel1;
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "");
Control ctrl = (Control)Session["ctrl"];
PrintHelper.PrintWebControl(ctrl);
}