ChangingResponse type at server side on click of button which is in updatepanel in ASP.NET
<p><BR>
Consider the following  ASP.NET Code</p>

<pre><code>&lt;asp:UpdatePanel ID="operationPanel" runat="server" UpdateMode="Always" RenderMode="Block"&gt;
  &lt;ContentTemplate &gt;
    &lt;asp:ImageButton runat="server" ID="btnSave" OnClientClick="return Client_Click()" ImageUrl="~/Images/Save_icon.png" OnClick="Server_Click" /&gt;
  &lt;/ContentTemplate&gt;
  &lt;Triggers&gt;
    &lt;asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" /&gt;
  &lt;/Triggers&gt;
&lt;/asp:UpdatePanel&gt;
</code></pre>

<p>And corresponding server code for button click is:</p>

<pre><code>protected void btnPbsh_Click(object sender, ImageClickEventArgs e)
{
  Response.Clear();
  Response.BufferOutput = false;
  string fileName = "sample.zip";
  Response.ContentType = "application/octet-stream";
  Response.AddHeader("content-disposition", "attachment; filename=\"sample.zip");
  Response.WriteFile(lclZipFileName);
  Response.Flush();
  Response.End();
}
</code></pre>

<p>Please ignore sytax and logical error.</p>

<pre><code>On click of button it displays error like in IE
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'PK'.
</code></pre>

<p><BR>
and nothing happens in Firefox.
<BR>
I am not able to figure out the error and the cause.
<BR>
Thanks,
<BR>
Amit Shah</p>
