Hello Guys! I'm tryting to export the contents of a grid view control to excel, but am facing an error. I have pasted the code below. I have used this code sucessfully while using a datagrid. Could you please point out as to where i am wrong.
Dim attachment As String = "attachment; filename=Contents.xls"
Response.ContentType = "application/ms-excel"
Dim sw As New System.IO.StringWriter
Dim htw As New HtmlTextWriter(sw)