I am trying to export gridview to excel but facing the error "Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed". I haven't form tag for this page. Please find the code below:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:Panel ID="PanelTest" runat="server">
<asp:GridView ID="GridViewTest" runat="server"
DataSourceID="DSTest" AllowSorting="True" AllowPaging="True" PageSize="10">
<Columns>.......</Columns> </asp:GridView><asp:Button
ID="btnExportGrid" runat="server"
Text="Export to Excel" OnClick="BtnExportGrid_Click" /></asp:Panel>
</asp:Content>