How to populate xml file  
Author Message
bslim





PostPosted: Visual C# General, How to populate xml file Top

Hi,

I am new to populate xml file.

My xml configuration file is as follow:

<% Page Language="C#" AutoEventWireup="true" CodeFile="MainTreeView.aspx.cs" Inherits="MainTreeView" %>

<html>

<body>

<form id="frmReport" runat="server">

<asp:TreeView id="ReportTreeView"

runat="server">

<Nodes>

<asp:TreeNode Value="Report"

NavigateUrl="main.aspx"

Text="Report"

Target="Content"

Expanded="True">

<asp:TreeNode Value="EOW"

Text="EOW"/>

<asp:TreeNode Value="EqpA"

NavigateUrl="EOW.aspx"

Text="EqpA"

Target="Content"/>

<asp:TreeNode Value="EqpB"

NavigateUrl="EOW.aspx"

Text="EqpB"

Target="Content"/>

</asp:TreeNode>

</Nodes>

</asp:TreeView>

</form>

</body>

</html>

It turn out that EqpA, EqpB and EOW is all under Report.

I would like to have the structure as follow:

Report

----> EOW

--------> EqpA

--------> EqpB

That means, EqpA and B should be the child of EOW.

May I know how to do that Can anyone please help Thanks



Visual C#18  
 
 
folen





PostPosted: Visual C# General, How to populate xml file Top

if i get u rigth:

<asp:TreeNode Value="EOW"

Text="EOW">

<asp:TreeNode Value="EqpA"

NavigateUrl="EOW.aspx"

Text="EqpA"

Target="Content"/>

<asp:TreeNode Value="EqpB"

NavigateUrl="EOW.aspx"

Text="EqpB"

Target="Content"/>

</asp:treenode>

</asp:TreeNode>

</Nodes>

</asp:TreeView>

 

caz < ../> meen one noode

<..>

... <---children of the nood

</..>

 


 
 
littleguru





PostPosted: Visual C# General, How to populate xml file Top

First of all: this looks like a HTML page, not like an XML configuration file to me. An XML file needs to have one root node and can have several child nodes. But it doesn't need to have a form, body, html node and the processing information at the top of the file.

Your XML file could look like this:

<report>
<EOW Text="some text">
<EqpA NavigateTo="someurl.apsx">some text</EqpA>
<EqpB NavigateTo="someotherurl.aspx">some text</EqpB>

</EOW>
</report>



 
 
bslim





PostPosted: Visual C# General, How to populate xml file Top

Hi,

Thanks for your help. I got it.