asp.net导出excel提示Control ‘GridView1’ of type ‘GridView’ must be placed

Posted: May 9, 2011 in ASP.NET
1、在导出界面中重载   
          public   override   void   VerifyRenderingInServerForm(Control   control)   
          {   
                  //base.VerifyRenderingInServerForm(control);   
          }   
  2、在web.config中修改<pages   enableEventValidation   =”false”   ></pages>   
  或   
    
  <%@   Page   Language=”C#”   EnableEventValidation   =   “false”   AutoEventWireup=”true”   
    
    CodeFile=”ExportGridView.aspx.cs”   Inherits=”ExportGridView”   %>   
    
  3、现在可以正常导出了。 
Advertisements

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