C# Sys.WebForms.PageRequestManagerParserErrorException

C# Sys.WebForms.PageRequestManagerParserErrorException,c#,.net,asp.net,exception-handling,C#,.net,Asp.net,Exception Handling,我正在使用母版页作为我的页面。在这个页面中,我在updatepanel中有gridview。我想将GridView导出到Excel。在这样做的时候,我得到了这样的错误 Sys.WebForms.PageRequestManagerParserErrorException:无法分析从服务器收到的消息。此错误的常见原因是当通过调用response.Write()修改响应、启用响应筛选器、HttpModules或服务器跟踪时。 详细信息:分析“附近”时出错 Sys.WebForms.PageReque

我正在使用母版页作为我的页面。在这个页面中,我在updatepanel中有gridview。我想将GridView导出到Excel。在这样做的时候,我得到了这样的错误

Sys.WebForms.PageRequestManagerParserErrorException:无法分析从服务器收到的消息。此错误的常见原因是当通过调用response.Write()修改响应、启用响应筛选器、HttpModules或服务器跟踪时。 详细信息:分析“附近”时出错 Sys.WebForms.PageRequestManagerParserErrorException:无法分析从服务器收到的消息。此错误的常见原因是当通过调用response.Write()修改响应、启用响应筛选器、HttpModules或服务器跟踪时

详细信息:分析“附近”时出错 尽管我添加了以下内容:

EnableEventValidation ="false"

<asp:AsyncPostBackTrigger ControlID="btn_export" EventName="Click" />
EnableEventValidation=“false”
我的标记:

<%@ Page Language="C#" MasterPageFile="~/C2SFAMaster.master" AutoEventWireup="false"     EnableEventValidation ="false"   CodeFile="GDNReport.aspx.cs" Inherits="GDNReport" Title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit, Version=1.0.11119.21057, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
<table>
<tr>
<td>
<TABLE class="TableBgColor">
<TBODY>
<TR class="TableHDColor"><TD colSpan=6>Sample Dispatch Note Report</TD></TR>
<TR>
    <td>Select Fs</td>
    <td>
        <asp:DropDownList ID="cmb_fs" runat="server" Width="200px" AppendDataBoundItems="True" SkinID="DropDowns">
            <asp:ListItem Value="-99">--------------------ALL------------------</asp:ListItem>
        </asp:DropDownList></td>
    <td>DateFrom</td>
    <td>
        <asp:TextBox id="txt_frdate" runat="server" SkinID="Textboxs" />
        <cc1:CalendarExtender id="CalendarExtender1" runat="server" TargetControlID="txt_frdate" Format="d/MM/yyyy" />
    </td>
    <td>DateTo</td>
    <td>
        <asp:TextBox id="txt_todate" runat="server" SkinID="Textboxs" />
        <cc1:CalendarExtender id="CalendarExtender2" runat="server" TargetControlID="txt_todate" Format="d/MM/yyyy" />
    </td>
</TR></TABLE> 
</td>
</tr>
<tr>
    <td align ="center" >
        <asp:Button ID="btn_view" runat="server" Text="View" OnClick="btn_view_Click" OnClientClick="return viewcheck();" CssClass="Button" />
    </td>
</tr>
<tr>
<td align="center"> 
    <asp:UpdatePanel id="swpnl" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:GridView ID="gdview" runat="server" OnRowDataBound="gdview_RowDataBound"    OnRowCreated="gdview_RowCreated" style="position: relative" />
        </ContentTemplate>
        <triggers>
            <asp:AsyncPostBackTrigger ControlID="btn_view" EventName="Click">    </asp:AsyncPostBackTrigger>
            <asp:AsyncPostBackTrigger ControlID="btn_export" EventName="Click" />
        </triggers>
    </asp:UpdatePanel>
    <asp:Button ID="btn_export" runat="server" CssClass="Button" OnClick="btn_export_Click" Style="position: relative" Text="Export To Excel" />    
</td></tr>
</table>
</asp:Content>

发送通知报告样本
选择Fs
--------------------全部------------------
从
达特托

我猜在
updatepanel
请求中,您正试图将数据写入
响应流

我认为这不会很好地工作,因为它将尝试向
更新面板处理程序添加
写入响应
,这将不喜欢您尝试向其写入文件,而我从未尝试过这样做


您最好使用正常的
回发
;或者如果必须是
async
则向另一个写入文件的处理程序发送
重定向
,这将有助于查看btn\u导出\u单击后的代码