getting following error while converting panel to image
1. System.Web.UI.WebControls.Panel does not contain definition for DrawToBitmap and no extension method DrawToBitmap
2. The best overloaded method match for system.drawing
using (Bitmap graphicSurface = new Bitmap(pnlContents.Width, pnlContents.Height))
{
using (StreamWriter bitmapWriter = new StreamWriter("TEST.JPEG"))
{
pnlContents.DrawToBitmap(graphicSurface, new Rectangle(0, 0, panel1.Width, panel1.Height));
graphicSurface.Save(bitmapWriter.BaseStream, ImageFormat.Jpeg);
}
}