I am using the following code to export a gridview into Excel:
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
On the same form that the gridview control is in there is also a couple of dropdown list with various information. Well when I use the above code to export the Gridview I get all the values from the dropdowns to appear on the spreadsheet too. How do I make it so only the information from the gridview appears in the Excel spreadsheet and nothing else? Thanks.