Export data to excel in asp.net
<p>I need to export the content of place holder within the table to excel. When I simply put that placeholder within the div  I can export the data(tables) to excel. But when I put that within the td of the table I was able to export only the title but not the content of place holder.</p>

<pre><code>&lt;asp:Panel ID="pnlMilestone" runat="server" CssClass="milestone-wrapper"&gt;
    &lt;div id="TableLists" runat="server" class="milestone-chart-wrapper"&gt;         
    &lt;table&gt;
        &lt;tr&gt;
            &lt;td style="text-align: center;"&gt;
                &lt;asp:Label ID="lblChartTitle" runat="server" Visible="False" Font-Bold="True"&gt;&lt;/asp:Label&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;
                &lt;div runat="server" id="bartable_render"&gt;
                    &lt;div id="bar_chart" style="height: 315px; width: 800px; margin-left: 150px;"&gt;
                    &lt;/div&gt;
                    &lt;div id="bar" style="height: 345px; width: 800px; margin-left: 10px;"&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
        &lt;asp:PlaceHolder ID="phDynamicTabular" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
     &lt;/div&gt;
&lt;/asp:Panel&gt;
</code></pre>

<p>Export Code:</p>

<pre><code> Response.Clear();
 Response.AddHeader("content-disposition", "attachment;filename=ProjectTarget_" + CampaignID + ".xls");
 Response.Charset = "";
 Response.ContentType = "application/vnd.xls";
 StringWriter stringWrite = new StringWriter();
 HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

 TableLists.RenderControl(htmlWrite);
 Response.Write(stringWrite.ToString());
 Response.End();
</code></pre>
