Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

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

Please can you help me.

Thanks.
Posted

1 solution

Hi,
It is much clear that you have set both DataSource and DataSourceID for your Treeview, remove one of two either use:
C#
TreeView1.DataSource = SiteMapDataSource1;
            TreeView1.DataBind();
or use datasource like
ASP.NET
<asp:treeview id="tvPages" runat="server" showcheckboxes="Leaf" datasourceid="OdsPages" xmlns:asp="#unknown">
                           </asp:treeview>
here OdsPages is ObjectDataSource Class[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900