Export DataList to Excel
Can someone please help. I was able to export my Gridview to Excel, but had to use a datalist instead due to some unique bindings I had to place on the contents.
I tried simply changing "GridView" to "DataList" and it didn't work.
Dim MyGridView As New GridView()
'MyGridView = GridView1
MyGridView.DataSource = KnightsDataSource
Dim attachment As String = "attachment; filename=Members.xls"
Response.ContentType = "application/ms-excel"
Dim sw As IO.StringWriter = New IO.StringWriter()
Dim htw As HtmlTextWriter = New HtmlTextWriter(sw)