問題描述:
只能在執行 Render() 的過程中調用 RegisterForEventValidation(RegisterForEventValidation can only be called during Render(); ) 解決方法:
1.修改web.config
<pages enableEventValidation ="false" ></pages>
2.直接在導出Execl的頁面修改
<%@ Page Language="C#" EnableEventValidation = "false" AutoEventWireup="true"
CodeFile="ExportGridVIEw.ASPx.cs" Inherits="ExportGridVIEw" %>