Introduction: in this post I will explain how we can solve the
error “RegisterForEventValidation can only be called during Render();"
Description:
In the last article I
have explained Control 'grdstudent' of type 'GridView' must be placed inside a form tag with runat=server, How to Export Gridview Data to PDF in Asp.net and How to Export Gridview Data to CSV in Asp.net.
Error occur when we try to Export the Data from Controls to
Pdf, Excel, Word, CSV. To solve this error add EnableEventValidation = "false" to @Page
directive of .aspx page as shown below:
<%@ Page
Language="C#"
AutoEventWireup="true"
CodeFile="Gridview_SelectExportRow.aspx.cs"
Inherits="Gridview_SelectExportRow"
EnableEventValidation="false"
%>
I hope it will resolve your problem.
No comments:
Post a Comment