Saturday, August 31, 2013

RegisterForEventValidation can only be called during Render();

Introduction: in this post I will explain how we can solve the error “RegisterForEventValidation can only be called during Render();"

RegisterForEventValidation

Description:


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