Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Cannot download files because of a conflict between WebParts and UpdatePanels

Cannot download files because of a conflict between WebParts and UpdatePanels

Scheduled Pinned Locked Moved ASP.NET
sysadmindebuggingjsonhelp
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Muhammad Gouda
    wrote on last edited by
    #1

    if (file.Exists)
    {
    Response.Clear();
    Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
    Response.AddHeader("Content-Length", file.Length.ToString());
    Response.ContentType = "application/octet-stream";
    Response.WriteFile(file.FullName);
    Response.End();
    }

    I am using the above code to download files listed in a listbox control I am placing the listbox in WebPartZone to enable the client to change the page layout, also I put it in an AJAX UpdatePanel to disable postbacks When I use ONLY the UpdatePanel, it works well When I use ONLY the WebPartZone, it works well When I use both together, I get an exception saying: Sys.WebForms.PageRequestManagerParseErrorException: The message received from the server could not be parsed.Common causes for this error are when the response modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near 'MZ'.

    foreach(Minute m in MyLife) myExperience++;

    modified on Thursday, January 22, 2009 2:49 AM

    M 1 Reply Last reply
    0
    • M Muhammad Gouda

      if (file.Exists)
      {
      Response.Clear();
      Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
      Response.AddHeader("Content-Length", file.Length.ToString());
      Response.ContentType = "application/octet-stream";
      Response.WriteFile(file.FullName);
      Response.End();
      }

      I am using the above code to download files listed in a listbox control I am placing the listbox in WebPartZone to enable the client to change the page layout, also I put it in an AJAX UpdatePanel to disable postbacks When I use ONLY the UpdatePanel, it works well When I use ONLY the WebPartZone, it works well When I use both together, I get an exception saying: Sys.WebForms.PageRequestManagerParseErrorException: The message received from the server could not be parsed.Common causes for this error are when the response modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near 'MZ'.

      foreach(Minute m in MyLife) myExperience++;

      modified on Thursday, January 22, 2009 2:49 AM

      M Offline
      M Offline
      Muhammad Gouda
      wrote on last edited by
      #2

      Wow... It seems HOPELESS case :(( :(( :(( Nobody want to answer :confused::confused:

      foreach(Minute m in MyLife) myExperience++;

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups