Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
private XMLDocument xDoc = null;
protected void [MyEvent](object sender, EventArgs e)
{
if(xDoc == null)
{
this.xDoc = new XMLDocument();
this.xDoc.LoadXML("<Root/>");
xDoc.AppendChild(AppendTreeViewNode(this.myTreeView.TopNode));
xDoc.Save("filename.xml");
}
}
private XmlNode AppendTreeViewNode(TreeViewNode treeNode)
{
XmlNode toReturn = this.xDoc.CreateNode(NodeType.Element);
XmlAttribute text = this.xDoc.CreateNode(NodeType.Attribute);
XmlAttribute value = this.xDoc.CreateNode(NodeType.Attribute);
text.Name = "DisplayText";
text.Value = treeNode.Text;
value.Name = "Value";
value.Value = treeNode.Value;
toReturn.Attributes.Add(text);
toReturn.Attributes.Add(value);
foreach(TreeViewNode child in treeNode.Children)
{
toReturn.AppendChild(AppendTreeViewNode(child));
}
return toReturn;
}