类型为"GridView"的控件"gvItemUpdate"必须放置在带有runat = server的表单标记中. [英] Control 'gvItemUpdate' of type 'GridView' must be placed inside a form tag with runat=server.
本文介绍了类型为"GridView"的控件"gvItemUpdate"必须放置在带有runat = server的表单标记中.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
当我打印时,出现此错误-
控件' gvItemUpdate'类型为 GridView'必须放在带有runat = server的表单标签中.
我该如何解决.
解决方案
错误告诉您可能是将控件放在 aspx中(在 表单元素之外)的地方或作为< b> </ b 没有具有runat =
类型为"GridView"的控件"gvItemUpdate"必须放置在表单标签内使用runat = server
当尝试将GridView控件导出为Word,Excel,PDF,CSV或任何其他格式时,会发生上述异常.
原因:
.NET编译器认为该控件未添加到表单中并被呈现.
解决方案:
告诉编译器该控件由overriding
和VerifyRenderingInServerForm
事件显式呈现.
像这样的东西:
公共 覆盖 void VerifyRenderingInServerForm(控制控件) { /* 验证控件是否已呈现*/ }
此错误/问题已报告& MS在此处建议的分辨率: RenderControl不适用于GridView [^ ]
可能是您的网格视图放错了位置,请保留在您的代码runat ="server"中,或者检查一次您的代码是否位于标记内r >Hello all,
When i go to print, I am getting this error -
Control 'gvItemUpdate' of type 'GridView' must be placed inside a form tag with runat=server.
How can i solve it.解决方案The error tells that you probably either misplaced your control in aspx (outside of form element) or that as<b></b>px form element does not have runat="server"
Control ''gvItemUpdate'' of type ''GridView'' must be placed inside a form tag with runat=server
The above exception occurs when one tries to export a GridView control to Word, Excel, PDF, CSV or any other formats.
Reason:
.NET compiler thinks that the control is not added to the form and is rendered.
Solution:
Tell compiler that the control is rendered explicitly byoverriding
theVerifyRenderingInServerForm
event.
Something like:
public override void VerifyRenderingInServerForm(Control control) { /* Verifies that the control is rendered */ }
This Error/issue reported & resolution suggested by MS here: RenderControl doesn''t work for GridView[^]
may be your gridview is misplaced please keep in ur code runat="server" or check once your code inside tag r not
这篇关于类型为"GridView"的控件"gvItemUpdate"必须放置在带有runat = server的表单标记中.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文