Wednesday, February 18, 2009

ASP.NET: UpdatePanel and Response.Write()


When you are modifying Response with Response.Write() from control which is inside UpdatePanel you may receive an error "Message received from the server could not be parsed"


Solution is to add a trigger to UpdatePanel like this:

    <asp:PostBackTrigger ControlID="btnExportToExcel" />

This causes an UpdatePanel to refresh the page only in control specified in Triggers section