CSV export to new Window?

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()
 
A

Aidy

Change the link the user clicks on and set the target to _blank;

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top