I have the following method which works fine in terms of exporting my gridview to excel
Protected Sub ExportToExcel2(ByVal objDT As DataTable, ByVal authAbbreviation As String)
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
EnableViewState = False
Dim sw = New System.IO.StringWriter()
Dim htw = New System.Web.UI.HtmlTextWriter(sw)
gvResults.DataSource = objDT
The only problem is in the folder where the file is saved also gets created a directory that holds html and css for the file.
How can I avoid this so all the user gets is an excel file?