| re: Streaming Excel Content
Hi, Krishna,
In the first case it looks like the code in the method that handles the
click event of the button is executed twice.
The most probable reson for this is that this handler is attached to the
event twice - once in the auto-generated code by the VS, and once again
automatically because the attribute AutoEventWireUp is set to true (this is
the default value) in the Page directive. Try adding AutoEventWireUp="False"
in the Page directive.
Hope this helps
Martin
"Krishna" <anonymous@discussions.microsoft.com> wrote in message
news:91D68AC9-7DBA-4E1D-83EF-BB59EC8D7D9A@microsoft.com...[color=blue]
> I am trying to stream html content as excel data from a
> webserver to an IE browser with the following ASP.NET code
>
> First Scenario:
> -----------------
> An aspx page with a server side button control.
> When button is clicked, form is posted and the following code is executed[/color]
on the server side.[color=blue]
>
> response.Buffer =true;
> response.Charset = "";
> response.ContentType = "application/vnd.ms-excel";
> response.AppendHeader("Content-Disposition",[/color]
"attachment;filename=sample.xls");[color=blue]
> response.Write(data);
>
> IE shows two Open/Save Dialog boxes. It is pretty weird for
> the dialog to be prompted two times to download a single
> file. I am not sure whether this is problem in IE or I
> have to do any anything on the HTTP headers side..
> I am using IE 6.0 with SP1.
>
> Second Scenario:
> --------------------
> Another aspx page which has the same above listed code in the Page_Load[/color]
event. When this page is requested , IE throws up only one[color=blue]
> dialog box to download the file.
>
> I am not sure why IE behaves differently under the above stated scenarios.[/color]
I like IE to prompt only once. Any help to solve this problem will be
appreciated.[color=blue]
>
> Thanks
> Krishna
>
>
>[/color] |