Hello,
People, please help me...
I have a aspx page with 2 update panels and 2 buttons (btnFilter and btnClear) that are not in an update panel. One button is an asyncpostback trigger of one update panel, and the other button is an asyncpostback trigger of the second update panel. (I have a lot of pages with the same structure, but the problem is just in this one). When I click on one of these buttons, or a button in the update panel (btnRefresh), I get the following error:
Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
(Thats all I get, without the usual "Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled." and with no details).
When I change these two buttons to be PostBackTrigger instead of asyncpostback trigger, I don't get this error, though it causes a full postback of the page, wich I don't want to happen. And, there is still the same problem with the button that inside the update panel.
Does anyone knows what's the problem?
<form id="Form1" method="post" runat="server"><asp:ScriptManager runat="server" ID="scriptManager1"></asp:ScriptManager><script type="text/javascript" language="javascript"> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(InitializeRequest); prm.add_endRequest(EndRequest); var postBackElement; function InitializeRequest(sender, args) { if (prm.get_isInAsyncPostBack()) args.set_cancel(true); postBackElement = args.get_postBackElement(); if (postBackElement.id != 'btnClear') $get('UpdateProgress1').style.display = 'block'; } function EndRequest(sender, args) { if (postBackElement.id != 'btnClear') $get('UpdateProgress1').style.display = 'none'; } </script><table border="0" cellpadding="0" cellspacing="0"><tr><td><asp:UpdatePanel ID="UPnl" runat="server" UpdateMode="Conditional"><triggers><asp:AsyncPostBackTrigger ControlID="btnClear" EventName="Click" ></asp:AsyncPostBackTrigger></triggers><ContentTemplate><asp:panel id="pnlFilter" runat="server" Wrap="False"><fieldset class="styleBoxField"><legend style="COLOR: #264b00">Permission Event Log Filtering</legend><asp:Table id="Table5" runat="server" cellspacing="1" CellPadding="1" width="100%"><asp:TableRow><asp:TableCell width="10"></asp:TableCell><asp:TableCell width="10">User</asp:TableCell><asp:TableCell><select id="hsUser" class="styleInput" name="hsUser" runat="server"></select></asp:TableCell><asp:TableCell width="50"></asp:TableCell><asp:TableCell>Start Time</asp:TableCell><asp:TableCell><asp:TextBox ID="tbStartDate" runat="server" Text="enter date" ForeColor="GrayText" onClick="clearTB('tbStartDate')" Width="80"></asp:TextBox><ajaxToolkit:CalendarExtender TargetControlID="tbStartDate" ID="calStart" runat="server"></ajaxToolkit:CalendarExtender></asp:TableCell><asp:TableCell><asp:TextBox runat="server" ID="tbStartTime" Text="HH:MM" ForeColor="GrayText" Width="60" onclick="clearTimeTb('tbStartTime')" onblur="validateTime('tbStartTime')"></asp:TextBox></asp:TableCell></asp:TableRow><asp:TableRow><asp:TableCell width="10"></asp:TableCell><asp:TableCell width="70">Machine IP</asp:TableCell><asp:TableCell><input type="text" id="textUserMachine" class="styleInput" runat="server" name="textUserMachine" /></asp:TableCell><asp:TableCell width="10"></asp:TableCell></asp:TableRow><asp:TableRow><asp:TableCell width="10"></asp:TableCell><asp:TableCell>Permission Option</asp:TableCell><asp:TableCell><asp:DropDownList runat="server" ID="ddlPermissionOption"></asp:DropDownList></asp:TableCell><asp:TableCell width="50"></asp:TableCell><asp:TableCell>End Time</asp:TableCell><asp:TableCell><asp:TextBox ID="tbEndDate" runat="server" Width="80" Text="enter date" ForeColor="GrayText" onclick="clearTB('tbEndDate')"></asp:TextBox><ajaxToolkit:CalendarExtender TargetControlID="tbEndDate" ID="calEnd" runat="server"></ajaxToolkit:CalendarExtender></asp:TableCell><asp:TableCell><asp:TextBox runat="server" ID="tbEndTime" Text="HH:MM" ForeColor="GrayText" Width="60" onclick="clearTimeTb('tbEndTime')" onblur="validateTime('tbEndTime')"></asp:TextBox></asp:TableCell></asp:TableRow><asp:TableRow><asp:TableCell width="10"></asp:TableCell><asp:TableCell>Permission</asp:TableCell><asp:TableCell><asp:DropDownList runat="server" ID="ddlPermissions"></asp:DropDownList></asp:TableCell><asp:TableCell width="10"></asp:TableCell></asp:TableRow><asp:TableRow><asp:TableCell width="10"></asp:TableCell><asp:TableCell>Mac Address</asp:TableCell><asp:TableCell><asp:TextBox runat="server" ID="tbMacAddress" CssClass="styleInput" ToolTip="wildcards supported"></asp:TextBox></asp:TableCell><asp:TableCell width="10"></asp:TableCell></asp:TableRow><asp:TableRow><asp:TableCell width="10"></asp:TableCell><asp:TableCell>Switch IP</asp:TableCell><asp:TableCell><asp:TextBox runat="server" ID="tbSwitchIP" CssClass="styleInput" ToolTip="wildcards supported"></asp:TextBox></asp:TableCell><asp:TableCell width="10"></asp:TableCell></asp:TableRow><asp:TableRow><asp:TableCell width="10"></asp:TableCell><asp:TableCell>Switch group</asp:TableCell><asp:TableCell><asp:DropDownList runat="server" ID="ddlSwitchGroup"></asp:DropDownList></asp:TableCell><asp:TableCell width="10"></asp:TableCell></asp:TableRow><asp:TableRow><asp:TableCell width="10"></asp:TableCell><asp:TableCell>User comment</asp:TableCell><asp:TableCell><asp:TextBox runat="server" ID="tbComment" CssClass="styleInput" ToolTip="Enter all or part of the comment the user wrote when he changed the station permission"></asp:TextBox></asp:TableCell><asp:TableCell width="10"></asp:TableCell></asp:TableRow></asp:Table></fieldset></asp:panel></ContentTemplate></asp:UpdatePanel><!--buttons---><asp:Table runat="server" CellPadding="0"><asp:TableRow><asp:TableCell><asp:Button id="btnFilter" runat="server" Text="Filter" CssClass="styleButton" ToolTip="Filter according to the given criteria"></asp:Button></asp:TableCell><asp:TableCell><asp:Button id="btnClear" runat="server" Text="Clear" CssClass="styleButton" ToolTip="Clear criteria fields"></asp:Button></asp:TableCell></asp:TableRow></asp:Table></td></tr></table><asp:UpdatePanel ID="UPnl2" runat="server" UpdateMode="Conditional"><triggers><asp:AsyncPostBackTrigger ControlID="btnFilter" EventName="Click" ></asp:AsyncPostBackTrigger></triggers><ContentTemplate><table border="0" cellpadding="0" cellspacing="0"><tr><td height=20px></td></tr><tr><td><asp:panel id="pnlResults" runat="server"><asp:Table height="28px" id="Table6" runat="server" Width="<%#nInnerComponentWidth %>" cellspacing="0" CellPadding="0" CssClass="styleTableHeaderResults"><asp:TableRow><asp:TableCell width="1%"></asp:TableCell><asp:TableCell>Filtered Results:</asp:TableCell><asp:TableCell><asp:Label id="lblResults" runat="server" Width="48px" Text=""></asp:Label></asp:TableCell><asp:TableCell width="50"></asp:TableCell><asp:TableCell width="70%"></asp:TableCell><asp:TableCell width="3%" HorizontalAlign="Right"><asp:Button id="btnRefresh" runat="server" ToolTip="refresh" CssClass="styleRefreshIcon"></asp:Button></asp:TableCell><asp:TableCell Width="3%" HorizontalAlign="Right"><asp:Button id="btnExcelExport" CssClass="styleExcelExportIcon" runat="server" Text="" ToolTip="Export to Excel"></asp:Button></asp:TableCell><asp:TableCell width="1%"></asp:TableCell></asp:TableRow></asp:Table></asp:panel></td></tr><tr><td><div id="divResults" runat="server" style="overflow:auto; height:600" class="styleScrollColors" ><asp:datagrid id="DataGrid1" CssClass="styleBoxTable" runat="server" CellPadding="0" Cellspacing="0" OnSortCommand="DataGrid1_Sort" AllowSorting="True" AutoGenerateColumns="False" width="<%#nInnerComponentWidth %>" PageSize="100" PagerStyle-BackColor="LightGrey" PagerStyle-ForeColor="DimGray" HeaderStyle-CssClass="styleTableHeader styleDataGridFixedHeader" HeaderStyle-HorizontalAlign="Center"><SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#669999"></SelectedItemStyle><ItemStyle ForeColor="#000000" HorizontalAlign="Center"></ItemStyle><Columns><asp:BoundColumn DataField="UserName" HeaderText="User Name" SortExpression="UserName"></asp:BoundColumn><asp:BoundColumn DataField="UserIPAddress" HeaderText="Machine IP" SortExpression="UserIPAddress"></asp:BoundColumn><asp:BoundColumn DataField="strDate" HeaderText="Date" SortExpression="Date"></asp:BoundColumn><asp:BoundColumn DataField="MacAddress" HeaderText="Mac Address" SortExpression="MacAddress"></asp:BoundColumn><asp:BoundColumn DataField="SwitchIP" HeaderText="Switch IP" SortExpression="SwitchIP"></asp:BoundColumn><asp:BoundColumn DataField="SwitchGroupID" Visible="false"></asp:BoundColumn><asp:BoundColumn DataField="SwitchGroupName" HeaderText="Switch Group" SortExpression="SwitchGroupName"></asp:BoundColumn><asp:BoundColumn DataField="VerificationOption" HeaderText="Verification Option" SortExpression="VerificationOption"></asp:BoundColumn><asp:BoundColumn DataField="Comment" HeaderText="Comment" SortExpression="Comment"></asp:BoundColumn><asp:BoundColumn DataField="NewPermission" Visible="false"></asp:BoundColumn><asp:TemplateColumn HeaderText="Permission Description"><ItemTemplate><asp:Label runat="server" ID="lblPermissionDesc"></asp:Label></ItemTemplate></asp:TemplateColumn></Columns><PagerStyle Height=22px HorizontalAlign="Left" Mode="NumericPages"></PagerStyle></asp:datagrid></div></td></tr></table><asp:Label id="lblLastSortExpression" runat="server" Width="0px" Visible="False">UserName</asp:Label><asp:Label id="lblLastSortDirection" runat="server" Width="0px" Visible="False">DESC</asp:Label></ContentTemplate></asp:UpdatePanel><asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UPnl2" runat="server" DisplayAfter="500"><ProgressTemplate><div id="IMGDIV" align="center" valign="middle" runat="server" style="position: absolute;left: 50%;top: 80%;visibility:visible;vertical-align:middle;background-color:Transparent;"><asp:Image ID="Image1" runat="server" ImageUrl="../../Images/ajax-loader.gif" /></div></ProgressTemplate></asp:UpdateProgress></form>