如何解决此错误:'System.Web.UI.WebControls.TreeView'没有名为'TreeNode'的公共属性 [英] How do I soleve this error: 'System.Web.UI.WebControls.TreeView' does not have a public property named 'TreeNode'
本文介绍了如何解决此错误:'System.Web.UI.WebControls.TreeView'没有名为'TreeNode'的公共属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
Hi
I have few errors in my code that I need help with. Firstly in this line of code; "<asp:TreeNode Expanded="True" Selected="true" Value="STAFF_WFIN">" I get a warning that TreeNode is unknown element and might be caused by missing web.config file , can I get help with, maybe there's something I did wrong there.
Secondly, when I try to run it I get this error: 'System.Web.UI.WebControls.TreeView' does not have a public property named 'TreeNode'
Code attached.
<asp:treeview id="TreeView1" runat="server" class="cssTreeView" ondblclick="tvwDoubleClick();" oncontextmenu="tvwRightClick();" defaultStyle="font-family:verdana;font-size:8pt;" selectedNodeIndex="0" HelperID="__TreeView1_State__" systemImagesPath="/webctrl_client/1_0/treeimages/" autoSelect="true" onexpand="javascript: if (this.clickedNodeIndex != null) this.queueEvent('onexpand', this.clickedNodeIndex)" oncollapse="javascript: if (this.clickedNodeIndex != null) this.queueEvent('oncollapse', this.clickedNodeIndex)" oncheck="javascript: if (this.clickedNodeIndex != null) this.queueEvent('oncheck', this.clickedNodeIndex)" onselectedindexchange="javascript: if (event.oldTreeNodeIndex != event.newTreeNodeIndex) this.queueEvent('onselectedindexchange', event.oldTreeNodeIndex + ',' + event.newTreeNodeIndex)" onfirequeuedevents="javascript: window.setTimeout('__doPostBack(\'TreeView1\',\'\')', 0, 'JavaScript')" style="height:100%;width:194px;">
<asp:TreeNode Expanded="True" Selected="true" Value="STAFF_WFIN">
Summary Reports
<asp:TreeNode Expanded="True" NodeData="dbo.vwCS_WFIN_STAFF;/AWDBI/WORK FINALISED/AGE ANALYSIS/DETAILS" ID="WFIN_CUSTAGE">
Work Finalised </asp:TreeNode>
<asp:TreeNode Expanded="True" NodeData="dbo.vwCS_WIP_STAFF;/AWDBI/WORK IN PROGRESS/AGE ANALYSIS/DETAILS" ID="WIP_CUSTAGE">
Work In Progress </asp:TreeNode>
<asp:TreeNode Expanded="True" NodeData="dbo.vwCS_WREC_STAFF;/AWDBI/WORK RECEIVED/AGE ANALYSIS/DETAILS" ID="WREC_CUSTAGE">
Work Received </asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Expanded="True" Value="STAFF_WIP">
Work In Progress
<asp:TreeNode Expanded="True" NodeData="dbo.vwCS_WIP_STAFF;/AWDBI/WORK IN PROGRESS/AGE ANALYSIS" ID="WIP_AGE">
WIP Age Analysis </asp:TreeNode>
<asp:TreeNode Expanded="True" NodeData="dbo.vwCS_WIP_STAFF;/AWDBI/WORK IN PROGRESS/AGE ANALYSIS/DETAILS" ID="WIP_CUSTAGE">
WIP Custom Age </asp:TreeNode>
</asp:TreeNode>
推荐答案
包装TreeNode
在节点
部分,例如
Wrap theTreeNode
's in aNodes
section, e.g.
<asp:treeview runat="server" xmlns:asp="#unknown">
<nodes>
<asp:treenode>My First Node</asp:treenode>
</nodes>
</asp:treeview>
这篇关于如何解决此错误:'System.Web.UI.WebControls.TreeView'没有名为'TreeNode'的公共属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文