RegisterForEventValidation can only be called during Render();

Error : RegisterForEventValidation can only be called during Render();


RegisterForEventValidation can only be called during Render(); during export of Gridview to excel or word or csv in double Gridview Or ListView Or Detailsview Access in Same Form using got this Errors use this Methods.


Show this Errors

RegisterForEventValidation can only be called during Render();



The Errors  Display in whereever in form using Render Control ().

Add the @Page Directives

 EnableEventValidation ="false" 


                        Html Coding


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Excel.aspx.cs" Inherits="Excel" EnableEventValidation ="false" %>




Code Behind 

Rendering Control


 public override void  VerifyRenderingInServerForm(Control control)
    {
        //base.VerifyRenderingInServerForm(control);
    }









0 comments:

Post a Comment