错误:“DataSource和DataSourceID都在'TreeView1'上定义。删除一个定义。“ [英] Error: "Both DataSource and DataSourceID are defined on 'TreeView1'. Remove one definition."

查看:81
本文介绍了错误:“DataSource和DataSourceID都在'TreeView1'上定义。删除一个定义。“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我收到此错误DataSource和DataSourceID都在'TreeView1'上定义。删除一个定义。



请帮帮我。



谢谢。

Hello,

I am getting this error "Both DataSource and DataSourceID are defined on 'TreeView1'. Remove one definition."

Please can you help me.

Thanks.

推荐答案



很明显,你已经为Treeview设置了DataSource和DataSourceID,删除其中一个使用:
Hi,
It is much clear that you have set both DataSource and DataSourceID for your Treeview, remove one of two either use:
TreeView1.DataSource = SiteMapDataSource1;
            TreeView1.DataBind();

或使用数据源,如

<asp:treeview id="tvPages" runat="server" showcheckboxes="Leaf" datasourceid="OdsPages" xmlns:asp="#unknown">
                           </asp:treeview>

此处OdsPages是 ObjectDataSource类 [ ^ ]

here OdsPages is ObjectDataSource Class[^]


这篇关于错误:“DataSource和DataSourceID都在'TreeView1'上定义。删除一个定义。“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆