问题描述
我正在尝试从gridview控件导出到一个excel文件,使用
代码用于数据网格控件(它在网上,如果要求
请发帖。
我收到错误。
控件''gvSearch''类型''GridView''必须放在一个表格标签中
with runat = server。
此错误类似于当数据网格具有
服务器端控件(如编辑按钮等)时经历过,但我的gridview
非常简单,只显示文本字段(它是当然在一个带有runat = server的
表单标签内。
是否有任何调整可以让代码工作?或者是
a完全不同的方法唯一的方法?
干杯,
克里斯
Hi,
I''m trying to export from a gridview control, to an excel file using
code intended for a datagrid control (it''s all over the web, can post if
requested)
I get the error.
Control ''gvSearch'' of type ''GridView'' must be placed inside a form tag
with runat=server.
This error is similar to that experienced when the datagrid had
server-side controls such as edit buttons and the like, but my gridview
is very plain, just displaying text fields (and it is of course inside a
form tag with runat=server).
Are there any tweaks that could be made to allow the code to work? or is
a completely different method the only way?
Cheers,
Chris
推荐答案
谢谢,但是我的代码并非如此,gridview(事实上几乎整个页面都是b $ b)都在< form>范围内。标签。
还有其他想法吗?我猜你的回答是没有理由
因为这不能在asp.net 2.0下工作?
干杯,
Chris
Thanks, but that it not the case with my code, the gridview (in fact
pretty much the whole page) is within the <form> tags.
Any other ideas? I''m guessing from your response that there''s no reason
for this not to work under asp.net 2.0?
Cheers,
Chris
这篇关于导出到Excel - ASP.net 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!