This is a migrated thread and some comments may be shown as answers.

Response object behaving abnormally after page is requested from radmanger response end

4 Answers 38 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
naga
Top achievements
Rank 1
naga asked on 02 Aug 2010, 10:21 PM
onResponseEnd, I m calling window.open, in the opened page, I m trying to perform on response stream object BinaryWrite to open a excel file. But it is not able to open the file from there.
When I used window.open directly and it worked with out any hassle.
How can I overcome this situation.

Requesting page

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <ClientEvents OnResponseEnd="onResponseEnd" />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
function onResponseEnd() {
           window.open(g_Url, "", g_SPopUpValues);
          
        } 

Requested page

protected void Page_Load(object sender, EventArgs e) {
FileStream MyFileStream;
        long FileSize;
        MyFileStream = new FileStream(@"c:\test.xls", FileMode.Open);
        FileSize = MyFileStream.Length;

        byte[] Buffer = new byte[(int)FileSize];
        MyFileStream.Read(Buffer, 0, (int)FileSize);
        MyFileStream.Close();
      
        Response.AddHeader("content-disposition", "attachment;filename=a.xls");
        Response.ContentType = "application/vnd.ms-excel";
        Response.BinaryWrite(Buffer);
         }

4 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 06 Aug 2010, 10:49 AM
Hello Naga,

I tried to reproduce the described issue, but to no avail. I am sending you a simple example which demonstrates the desired functionality. Please check it out and let me know what differs in your case.

Best wishes,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
naga
Top achievements
Rank 1
answered on 06 Aug 2010, 05:50 PM
Hi,
Thanks for your reply.
I'm able to reproduce the problem with your code as well.
It opens pop up window, with out prompting for excel save/open dialog.
If we click on it numerous times say 5 to 6 times, with out any timeinterval it shows it.
Here are my environment details.

O.S - Windows server 2008 R2 Standard
I.E Version - 8

By the way have you changed any security setting or any other setting in your IE or are they default.
Also, Using fiddler it shows me the content being written to browser, but it never shows the Excel dialog.

Thanks,
Naga.
0
naga
Top achievements
Rank 1
answered on 06 Aug 2010, 05:52 PM
P.S
Sorry, what is the size of the file which you are testing.
The excel file which we are showing is a report.
Report size is very small 10 records say.
0
Radoslav
Telerik team
answered on 11 Aug 2010, 12:40 PM
Hello Naga,

On the following link I attach a small video which demonstrates the example on my side. However, it works as expected.
Also I am using the default IE security settings. The size of the excel document which I use is 7 rows x 6 columns, 9KB.

Additionally could you please try using the RadAjaxPanel or asp:UpdatePanel instead of RadAjaxManager and let me know if the issue still persists.

Looking forward for your reply.

Greetings,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Ajax
Asked by
naga
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
naga
Top achievements
Rank 1
Share this question
or