Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
349
WARP and Response.TransmitFile()
posted

Hi, 

I have a web page with a WARP control, which contains a button and a few labels. I would like to click on the button inside the WARP, which results in a form being generated and then allows the user to download the form via Response.TransmitFile.

What I find at the moment is the form is generated ok(ie checked my code is working ok there), but when the code for the response.transmitfile is executed nothing happens. I would appreciate any help on this! Cheers David

The code snippet here is:

Response.AppendHeader("Content-Disposition", "attachement; filename=" + zipFileName.ToString());

Response.ContentType = "application/zip";

Response.TransmitFile(transmitFile);

Response.Flush();

Response.Close();

Response.End();

Parents
No Data
Reply
  • 45049
    Verified Answer
    posted

    WARP expects its response to be in a specific format.  When you take over the Response object in this fashion, you destroy the response that WARP was creating on the server.  When the response is read by the WARP on the client, it doesn't know what to do with it, and so discards the response entirely.

    You will likely need to do this during a full-page postback.  My advice is to add your button's ClientID to the TriggerPostBackIDs property of WARP.

Children