本文介绍了如何使用Gridview.RenderControl()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Gridview.RenderControl(),它给出了类似'Control'的错误'GridView''类型'GridView'必须放在带有runat = server的表单标签内。'

I am using Gridview.RenderControl(),it gives me error like 'Control 'GridViewID' of type 'GridView' must be placed inside a form tag with runat=server.'

推荐答案

<ctrls:mygridview  runat="server" id="myGridView" ... />





下次发帖时,请记住包含任何相关的标记和代码。

在这种情况下,它会很高兴看到标记只适用于GridView标记和RenderControl。渲染控制不是你的问题,但如果你认为它可以发布它。



希望有所帮助^ _ ^



Andy



next time you post, remember to include any relevant markup and code behind.
In this case it would have been nice to see the markup just for the GridView tag and the RenderControl. Render control was not your issue here but post it if you think it might be.

Hope that helps ^_^

Andy


thanks a lot for your reply.

my gridview column contains <asp:LinkButton />
which causes problem while rendering.

i solved this issue ,by removing <asp:LinkButton /> control from
gridview cell controls collection.


这篇关于如何使用Gridview.RenderControl()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 10:07