Cannot download files because of a conflict between WebParts and UpdatePanels
-
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
-
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
Wow... It seems HOPELESS case :(( :(( :(( Nobody want to answer :confused::confused:
foreach(Minute m in MyLife) myExperience++;