D
David Elliott
I am trying to use the TreeView Control that is part of the WebControls
package from Microsoft.
I was getting this error:
Exception Details: System.Xml.XmlException: The data at the
root level is invalid. Line 1, position 1.
I then set the permission for the file and then started getting:
Exception Details: System.Exception: The XML loaded from
TreeNodeSrc=state_city.xml, TreeNodeXslSrc= did not contain
the required outer <TREENODES> container.
The XML file clearly has it. If I cut and paste the XML file into the
the Page_Load and bind it to the control as a string, this works
jsut fine.
Any help would be appreciated.
Dave
===================
public class WebForm1 : System.Web.UI.Page
{
protected Microsoft.Web.UI.WebControls.TreeView MyTreeView;
private void Page_Load(object sender, System.EventArgs e)
{
MyTreeView.TreeNodeTypeSrc = @"state_city.xml";
MyTreeView.DataBind();
}
}
<?xml version="1.0" ?>
<TREENODES>
<treenode Text="Michigan">
<treenode Text="Detroit" />
<treenode Text="Farmington" />
<treenode Text="Southfield" />
</treenode>
<treenode Text="Washington">
<treenode Text="Bellevue" />
<treenode Text="Redmond" />
<treenode Text="Woodinville" />
</treenode>
</TREENODES>
package from Microsoft.
I was getting this error:
Exception Details: System.Xml.XmlException: The data at the
root level is invalid. Line 1, position 1.
I then set the permission for the file and then started getting:
Exception Details: System.Exception: The XML loaded from
TreeNodeSrc=state_city.xml, TreeNodeXslSrc= did not contain
the required outer <TREENODES> container.
The XML file clearly has it. If I cut and paste the XML file into the
the Page_Load and bind it to the control as a string, this works
jsut fine.
Any help would be appreciated.
Dave
===================
public class WebForm1 : System.Web.UI.Page
{
protected Microsoft.Web.UI.WebControls.TreeView MyTreeView;
private void Page_Load(object sender, System.EventArgs e)
{
MyTreeView.TreeNodeTypeSrc = @"state_city.xml";
MyTreeView.DataBind();
}
}
<?xml version="1.0" ?>
<TREENODES>
<treenode Text="Michigan">
<treenode Text="Detroit" />
<treenode Text="Farmington" />
<treenode Text="Southfield" />
</treenode>
<treenode Text="Washington">
<treenode Text="Bellevue" />
<treenode Text="Redmond" />
<treenode Text="Woodinville" />
</treenode>
</TREENODES>