Open the excel in new page while exporting

C

chandra82_tech

Hi,

I have implemented export to excel functionality, which actually
exports the contents of HTML table to a excel sheet and asks for user
input on whether to open or save or cancel. The issue is when the user
clicks on "Open", the excel is opened in the same window where it is
being called or initiated, can i make it open in a new window?
Right now this how my code looks,
Context.Response.Clear();
//for displaying the open save dialogue box.
Context.Response.AddHeader("content-disposition",
"inline;filename=ExportContents");
Context.Response.Charset = "";
//set the target file type as excel.
Context.Response.ContentType = "application/vnd.ms-excel";

and i'm using a StringBuilder class to get all the information from my
HTML table and exporting to the excel by the following code,
//write to the excel sheet
Context.Response.Write(sb.ToString());
Context.Response.End();

-Chandra
 

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

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top