Hello i got 2 pages with exporting to excel , i use something like this :
Response.ClearContent()
Response.Buffer = True
Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", "poView.xls"))
Response.ContentEncoding = Encoding.UTF8
Response.ContentType = "application/ms-excel"
Dim tw As New IO.StringWriter()
Dim htw As New HtmlTextWriter(tw)
budgetPlanGrid.RenderControl(htw)
Response.Write(tw.ToString())
Response.[End]()
Now i do manage to export into excel and see the needed grid, but on the more complex page which has alot more stuff in it for some reason beside the gridview i see parts from my masterpage! and it yells at me that i am missing the path for my style.css which has nothing to do with the gridview i am trying to export!. I used 2 panels to make everything up untill / from the gridview visible = false, I am kinda clueless what else could have caused that.
I am hoping maybe someone had this sort of issue while using this code and can advice me on what to look for? Thanks in advanced!