I have an UpdatePanel with the following Triggers:
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlNames" EventName="SelectedIndexChanged" />
<asp:PostBackTrigger ControlID="btnPullReport"/>
</Triggers>
When the SelectedIndexChanged event is triggered I can see my loading gif from the UpdateProgress but when I click the btnPullReport
button I do not.
It must be of type PostBackTrigger or else I get error:
0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
The btnPullReport creates an Excel file and prompts the user to save it.
The last lines in the btnPullReport_Click are these:
Response.Clear();
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", "attachment; filename=Report.xlsx");
package.SaveAs(Response.OutputStream);
Response.End();
The error happens at Response.End();
and it states: {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}
How can I make it so that it displays the UpdateProgress bar after clicking the button also?