I am having a form with asp panel which contains table under it,I need to create a Header with Image I have done in the following way,but only image is coming,If I try with only panel then its working.I need both of them.Pls help me in this regard.Below is my code,
<asp:Panel ID="pnlPerson" runat="server">
<table border="1" style="font-family: Arial; font-size: 10pt; width: 200px">
<tr>
<td colspan="2" style="background-color: #18B5F0; height: 18px; color: White; border: 1px solid white">
<b>
Payment Confirmation for ProJKRM Membership</b>
</td>
</tr>
<tr>
<td><b>Name:</b></td>
<td><asp:Label ID="lblName" runat="server"></asp:Label></td>
</tr>
</table>
</asp:Panel>
Code Behind is:
private void Sendpdf(string OrderID)
{
ThankYou_BLL obj = new ThankYou_BLL();
dspdf = obj.ThankUdetails(OrderID);
if (dspdf.Tables[0].Rows.Count > 0)
{
lblName.Text = dspdf.Tables[0].Rows[0]["FullNme"].ToString();
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=Panel.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f);
PdfWriter.GetInstance(pdfDoc, new FileStream(Context.Server.MapPath("~/PdfDoc/ProJKRMMembershipPaymentDetails.pdf"), FileMode.Create));
StringReader sr = new StringReader(sw.ToString());
pdfDoc.Open();
iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance(Server.MapPath("~/Admin/images/logo.png"));
pdfDoc.Add(png);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
pnlPerson.RenderControl(hw);
htmlparser.Parse(sr);
pdfDoc.Close();
}
With the above code only image is displaying,panel is unable to load.