I have problem using the Response object inside the updatepanel
<asp:UpdatePanel ID="UP_ExportPrompt" runat="server" UpdateMode="Always">
<ContentTemplate>
<div>
<ul>
<li>
<label class="f450">
<asp:Literal runat="server" Text="<%$ Resx : Reports_ExportOnlyPrompt %>" />
</label>
</li>
<li>
<label class="f80">
<asp:Label runat="server" Text="<%$ Resx : FileFormatColon %>" />
</label>
<asp:DropDownList ID="DDL_ExportFileType" runat="server">
<asp:ListItem Value="0" Text="Excel" />
<asp:ListItem Value="1" Text="PDF" />
<asp:ListItem Value="2" Text="Word" />
</asp:DropDownList>
</li>
<li class="right">
<asp:Button ID="BT_CreateExport" runat="server" Text="OK" OnClick="BT_CreateExport_OnClick" />
<asp:Button ID="BT_CreateReport" runat="server" Text="<%$ Resx : Reports_ContinueWithImmediateView %>" OnClick="BT_CreateReport_OnClick" />
<asp:Button ID="BT_Cancel" runat="server" Text="<%$ Resx : CancelVerb %>" OnClick="BT_Cancel_OnClick" />
</li>
</ul>
</div>
</ContentTemplate>
</asp:UpdatePanel>
The UP_ExportPrompt updatepanel content is shown in Nyro modal window. After clicking the BT_CreateExport , excel file is created and send to the client with the Response object. I'm not pasting code for this because it's irrelevant to the problem.
Now, I tried creating the button as trigger with
<Triggers>
<asp:PostBackTrigger ControlID="BT_CreateExport" />
</Triggers>
and it's not working again.
Anybody knows a solution of this problem ?
It's a known problem and "setting the button as trigger" solution appears to fix most of the cases with this problem here on SO ... but it's not working for me
The thrown error is:
0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
EDIT:
Ok, I've managed to find more info on the issue. Even if I set the PostBackTrigger
, the postback is still async. According to the documentation, the PostBackTrigger causes full postback to occur. In my case it doesn't, which is the problem.