You may get the following JavaScript error when clicking the Export button:
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 'PNG
The sample Export button fires the following code.
protected void ButtonExport_Click(object sender, EventArgs e) { DayPilotMonth1.DataSource = getData(DayPilotMonth1.VisibleStart, DayPilotMonth1.VisibleEnd, (string)DayPilotMonth1.ClientState["filter"]); DayPilotMonth1.DataBind(); Response.Clear(); Response.ContentType = "image/png"; Response.AddHeader("Content-Disposition", "attachment;filename=print.png"); DayPilotMonth1.Export(ImageFormat.Png).WriteTo(Response.OutputStream); Response.End(); }
It modifies the Response to return the PNG image instead of the page. That will not work if the button click is handled using partial PostBack.
In order to make the button work you need to handle the button click using a full page PostBack: