Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi all,
I am clicking btnDownloadWebConnector that was present inside asp:Updatepanel and in event of btnDownloadWebConnector_Click i am calling one function like the following
CodeBehind

C#
protected void btnDownloadWebConnector_Click(object sender, EventArgs e)
{
    string filename = Server.MapPath(@"~/ZSLWebConnect/ZSLWebConnectorSetup.msi");
    FileInfo fileToDownload = new FileInfo(filename);
    if (fileToDownload.Exists)
        {
        Response.ClearContent();
        Response.AddHeader("Content-Disposition", "attachment; filename=" + fileToDownload.Name);
        Response.AddHeader("Content-Length", fileToDownload.Length.ToString());
        Response.ContentType = "application/octet-stream";
        Response.TransmitFile(fileToDownload.FullName.ToString()); 
        Response.End();
        }
   }


After clicking the executing the above code i am getting the javascript error:"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 ''.
Can anyone please help me how to solve the above error?
Thanks in advance,
Bala.
Posted
Updated 27-Jan-11 6:20am
v3

1 solution

This is a common mistake, look for similar threads here[^].

Have a look at this blog entry[^] for reasons and resolutions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900