Hi,
Need some help with an problem that bugging me..
I have to open a .doc file at the client side when the user clicks a button.
Opening is not a problem.. I am able to do it using the following code
which is executed when the user clicks on the button
my code:
byte[] imagecontent = (byte[])(drd[0]);
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=" + drd.GetValue(1).ToString());
Context.Response.BinaryWrite(imagecontent);
The problem is that the user first sees a 'Open/ Save / Cancel' dialog box. Only when the user clicks on 'Open' does the .doc file get opened.
I am using following code but it does not working.
String strPop = "<script language='javascript'>" + Environment.NewLine +
"window.open('E:\MyWork\Test\DownloadFiles\Reports\Rpt.pdf"','Report','height=520,width=730,toolbars=no,scrollbars=yes,resizable=yes');" + Environment.NewLine +
"</script>" + Environment.NewLine;
Page.RegisterStartupScript("Pop", strPop);
Am at a loss and any help will be appreciated.
Thanks