CSV export to new Window?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have some code that exports a gridview to csv, some of the code is below..

What I am trying to do is make the csv file open in a new IE window as I
need to refresh the current window are the file is created. I cant seem to
that while using the Response.End etc. Any ideas how to do this?

Response.ContentType = "Application/x-msexcel"
Response.AddHeader("content-disposition", "attachment; filename="""
& filename & """")

'Write the file directly to the HTTP output stream.
Response.Write(sb.ToString)

Response.End()
 
Change the link the user clicks on and set the target to _blank;

<a href="CSV.aspx" target="_blank">
 
Back
Top