asp:使用xml数据源的treeview

时间:2016-04-01 06:17:35

标签: c# asp.net

<LocalHMDataSource HMType="Local" HMName="Local" HMConnectionString="Cn2XtvtEeXXnPEWXHrmEv3uAYpBUKsoEZZheff1P2ATMUiecrsp9ZsSEM92MySEB1CPcOfR8T2DLxfZOLiwKnTLdHNWC2Ws4RwYMtMg6DHTAnOD34" sdfs="sdfsdf" fddf="dfg" kdmfck="jhfurf">
</LocalHMDataSource>
<HMDataSource HMType="Oracle" HMName="ormatica" HMConnectionString="eImJT8DPTc4qgKnYwqkt0EWw2vGeDfK/hAoZaKZIDoVWUmDx0TX7X3nquoUnqSqEs7tu+YCicvzd84ogJCXGhkiXGAUJh0GeABwFQzUcb/Ekl/SRcE9xqyE5eqOs35aKNJTrDU67S3mPeE12HTWlXTYHm4qrCUHh8ox2iwdjAjkC1pyiCEoOb9zE5E9VIjKqva5yY3Io01z9svOuj8hP214MhrmCA/EryHywnXpDa95Q9PO6xF7fXf5sPqkggvb3jReQw==">
</HMDataSource>
<HMDataSource HMType="Sql" HMName="EDIClientSql" HMConnectionString="3wtHS7b0pMWSbP1Pn2q8Wa9H8HhcVfnJkOqeRpjVeQOc8z1jNfgrusSZZZvfAT5kNB4q2cRsGFmz6pMafwAb5OGyP45OOMFxT4LkjVtl518gtGMqcMw=">
</HMDataSource>
<HMDataSource HMType="LogFile" HMName="LogFile1" HMConnectionType="txt">
</HMDataSource>
<HMDataSource HMType="LogFile" HMName="LogFile2" HMConnectionType="xml">
</HMDataSource>
<HMDataSource HMType="REPORT" HMName="834E2EREPORT" HMConnectionType="NA">
</HMDataSource>
<HMDataSource HMType="CLEANUP" HMName="CLEANUP" HMConnectionType="NA" HMConnectionString="Cn2XtvtEeXK513v7xeqOCifw7XnPEWXHrmEv3uAYpBUKsoEZZheff1P2ATMUiec
<yudyu>ASHOK</yudyu>

上面是我的xml文件..

当我填充树视图添加删除操作时,我面临以下问题。

这是我的代码:

XmlDocument doc = new XmlDocument();
            doc.Load(Server.MapPath(Session["CurrentXMLFile"].ToString()));
            XmlNode node = doc.SelectSingleNode(TreeView.SelectedNode.DataPath);

选择最后一个或第三个子节点说(hmdatasource)它返回第一个childnodes数据路径。由于相同的子节点名称,我无法编辑或获取其他子节点路径。任何人都帮助我这个

0 个答案:

没有答案