On 24 abr, 19:30, "Ray Costanzo" <my first name at lane 34 dot
commercial> wrote:
> This works for me:
>
> protected void Page_Load(object sender, EventArgs e)
> {
> Response.ContentType = "application/vnd.ms-excel";
> Response.AddHeader ("Content-Disposition", "inline;
> filename=somefile.xls");
> }
>
> Ray at work
Thank you very much, but this didn't solve my problem (I'm using
Office 2007, this could be the problem, I'll try Office 2003).
Your code works fine to change the file name from "page.aspx" to
"somefile.xls" in Internet Explorer 7 dialog box. But when I choose
"save", the default file name appears as "page.xls" instead of
"somefile.xls".
Also, when I choose "open", Excel 2007 receives a "page.aspx" file so
it still gives a warning. When I go on, the workbook is properly
displayed but title in Excel windows remains "page.aspx".
It's the same with DOC files, Word 2007 still shows "page.aspx" as
window title, but no warnings are displayed.
Thank you again.
|