title: Textbox in Excel
body: <p>I have <code>Gridview</code> like this.</p>
  
  <p><img src="https://i.stack.imgur.com/QHuv9.jpg" alt="enter image description here"></p>
  
  <p>Here is my last column <code>Gridview</code> code;</p>
  
  <pre><code>&lt;EditItemTemplate&gt;
              &lt;asp:TextBox ID="txtTNOT" runat="server" Height="35" TextMode="MultiLine" DataSourceID="SqlDataSource8"&gt;&lt;/asp:TextBox&gt;
              &lt;asp:SqlDataSource ID="SqlDataSource8" runat="server" 
                ConnectionString="&lt;%$ ConnectionStrings:SqlServerCstr %&gt;" 
                SelectCommand="SELECT [T_NOT] FROM [TAKIP] WHERE T_HESAP_NO = @T_HESAP_NO "&gt;
                  &lt;SelectParameters&gt;
                    &lt;asp:Parameter Name="T_HESAP_NO" Type="String" /&gt;
                  &lt;/SelectParameters&gt;
              &lt;/asp:SqlDataSource&gt;
              &lt;/EditItemTemplate&gt;
  </code></pre>
  
  <p>My last column has a Textbox.</p>
  
  <p>When i import to excel with this code;</p>
  
  <pre><code>protected void LinkButton1_Click(object sender, EventArgs e)
    {
      Response.Clear();
      Response.AddHeader("content-disposition", "attachment;filename=TahTakip.xls");
      Response.Charset = "";
  
  
      Response.ContentType = "application/vnd.xls";
      System.IO.StringWriter stringWrite = new System.IO.StringWriter();
      System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
      GridView1.RenderControl(htmlWrite);
      Response.Write(stringWrite.ToString());
      Response.End();
    }
  </code></pre>
  
  <p>Still i have a <code>Textbox</code> in my <code>Excel</code> file.</p>
  
  <p><img src="https://i.stack.imgur.com/fl9A1.jpg" alt="enter image description here"></p>
  
  <p>How can i delete <code>Textbox</code> [NOT VALUE INSIDE COLUMN] when i exporting to <code>Excel</code>?</p>
  
  <p><strong>Best Regards,</strong></p>
  
  <p><strong>Soner</strong></p>