我试图从ascx控件中检索两个列表视图,以便将它们保存到PDF文件中:
<TagCloud:TagCloudControl ID="TagCloudControl1" runat="server" />
我得到以下错误:TagCloudControl1是一个字段,但它像类型一样使用,并且非静态字段、方法或属性需要对象引用。。。谢谢你的帮助!
ListView lv1 = (TagCloudControl1)ListView.FindControl("ListView1");
ListView lv2 = (TagCloudControl1)ListView.FindControl("ListView2");
lv1.RenderControl(htWriter);
lv2.RenderControl(htWriter);