gridview导出exe处理时遇到RegisterForEventValidation can only be called during Render();错误
如题,今天在利用GridView作execl导出时,遇到RegisterForEventValidation can only be called during Render();问题。根据网上找到的资料,有两种如下的解决方法:
1.修改web.config中的代码:
- <pages enableEventValidation ="false" ></pages>
但我们知道,在web.config中修改代码会影响到项目中的其它页面,所以不推荐使用;
2.直接在导出Excel的页面修改:
- <%@ Page Language="C#" EnableEventValidation = "false" AutoEventWireup="true"
- CodeFile="ExportGridView.aspx.cs" Inherits="ExportGridView" %>
标红的代码为新增的代码。
如此,GridView中的数据就可以成功得以Excel的形式导出
gridview导出exe处理时遇到RegisterForEventValidation can only be called during Render();错误的更多相关文章
- 当用GridView导出Execl的时候,会发生只能在执行 Render() 的过程中调用 RegisterForEventValidation的错误
当用GridView导出Execl的时候,会发生只能在执行 Render() 的过程中调用 RegisterForEventValidation的错误提示. 有两种方法可以解决以上问题: 1.修改we ...
- C# asp.net中导出Excel表时总出现"只能在执行 Render() 的过程中调用 RegisterForEventValidation
C# asp.net中导出Excel表时总出现"只能在执行 Render() 的过程中调用 RegisterForEventValidation 后台添加以下方法:/// <summa ...
- C# GridView 导出Excel表
出错1:类型“GridView”的控件“GridView1”必须放在具有 runat=server 的窗体标记内解决方案:在后台文件中重载VerifyRenderingInServerForm方法,如 ...
- iOS 导出 ipa 包时 四个选项的意义
iOS 导出 ipa 包时 四个选项的意义 如图 在 iOS 到处 ipa包的时候 会有四个选项 1.Save for iOS App Store Deployment 保存到本地 准备上传App ...
- asp.net教程:GridView导出到Excel或Word文件
asp.net教程:GridView导出到Excel或Word文件</ br> 在项目中我们经常会遇到要求将一些数据导出成Excel或者Word表格的情况,比如中国移动(我是中国移动用户) ...
- Export GridView Data to Excel. 从GridView导出数据到Excel的奇怪问题解析
GridView导出函数内容如下 string attachment = "attachment; filename=Contacts.xls"; Respo ...
- iOS 导出 ipa 包时 三个选项的意义
OS 导出 ipa 包时 三个选项的意思 如图 在 iOS 到处 ipa包的时候 会有三个选项 Save for iOS App Store Deployment Save for Ad Hoc D ...
- DevExpress GridControl GridView 导出到 Excel 类
说明: 1>GridView 导出到 Excel (如果分页,只导出当前页数据) 2>GridView 导出到 Excel 3>方法2可以参考DataTable 导出到 Excel ...
- 让InstallShield 2015 Limited Edition for Visual Studio 2015生成的setup.exe双击时以管理员权限运行
转载:http://blog.csdn.net/zztoll/article/details/52096700 如题,如何让InstallShield 2015 Limited Edition for ...
随机推荐
- flask综合案例
一.项目准备 1.新建项目目录students,并创建虚拟环境 mkvirtualenv students 2.安装依赖环境 pip install flask==0.12.4 pip install ...
- centos7安装SourceCodePro字体
1. 下载SourceCodePro字体,后缀应为.ttf. 2. 将字体文件复制到fonts(/usr/share/fonts)文件夹下: [root@centos fonts]# mv /home ...
- U盘安装CentOS 7错误 /dev/root does not exist, could not
问题: U盘安装CentOS 7,显示/dev/root does not exist, could not boot 解决方法: 1. 到windows里面查看U盘名称(例如 "Cento ...
- List<Type> 随机排序
public List<T> GetRandomList<T>(List<T> inputList){ //Copy to a array T[] copyArra ...
- PIE SDK主/次要分析
1.算法功能简介 主要分析功能是采用类似卷积滤波的方法将较大类别中的虚假像元归到该类中,首先定义一个变换核尺寸,然后用变换核中占主要地位(像元最多)类别数代替中心像元的类别数,次要分析相反,用变换核中 ...
- esper(4-4)-OverLapping Context
语法 create context context_name initiated [by] initiating_condition terminated [by] terminating_condi ...
- vue组件(持续更新)
1.vee-validate :vue的表单验证组件 网友博客介绍:https://www.cnblogs.com/xxwang/p/6104715.html
- (Frontend Newbie) Web三要素(一)
上一篇简单了解了Web发展的简要历史,本篇简单介绍前端开发的基本三要素:HTML.CSS.JavaScript中的HTML以及一些在开发.学习过程中易被忽视的知识点. HTML HTML全称是超文本标 ...
- Long 和 Integer
Integer 32位 其范围为 -2^31 到 2^31-1 之间,所以最大值是 2^31-1 Long 64位
- ksframework的xlua版本
https://github.com/zhaoqingqing/KSFramework_xlua