RegisterForEventValidation can only be called during Render(); - ASPMANTRA | Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server AND WCF snippets and tutorial

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.

What do you think about this article?

If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.


EmoticonEmoticon