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

5 posts, 0 answers
  1. naga
    naga avatar
    3 posts
    Member since:
    Apr 2009

    Posted 02 Aug 2010 Link to this post

    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);
             }
  2. Radoslav
    Admin
    Radoslav avatar
    1566 posts

    Posted 06 Aug 2010 Link to this post

    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
  3. naga
    naga avatar
    3 posts
    Member since:
    Apr 2009

    Posted 06 Aug 2010 Link to this post

    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.
  4. naga
    naga avatar
    3 posts
    Member since:
    Apr 2009

    Posted 06 Aug 2010 Link to this post

    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.
  5. Radoslav
    Admin
    Radoslav avatar
    1566 posts

    Posted 11 Aug 2010 Link to this post

    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
Back to Top