RegisterForEventValidation can only be called during Render();


Hi

I was getting this error, while converting gridview data to Excel and word format.

RegisterForEventValidation can only be called during Render();

Then I made  EnableEventValidation=”false” in page directive.Then it starts to work

Advertisements
Posted in Errors. 3 Comments »

3 Responses to “RegisterForEventValidation can only be called during Render();”

  1. Money Says:

    Does not work in case. I added this in the Page directive of the main page. I have a user control that has the gridview and a button that exports it to excel. i cannot add it to the User control as it does not have this property. So i added it to the main page directive. But does not do anything. Any suggestions?

    • Chandra Dev Says:

      Hi,

      Please give me some time. I donot have checked on that case.

    • Yossi Bressler Says:

      Money, I also had this issue in UserControl (that does not have EnableEventValidation property).

      Removing “asp:HiddenField” from the UserControl, solved the problem.
      I don’t know why, but it just worked for me.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: