What's wrong here.

M

Mark Goldin

Here is an ASP page:
<%@ Register TagPrefix="mytree" Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<%@ import namespace="Microsoft.Web.UI.WebControls"%>
<html>
<head>
</head>
<body>
<form runat="server">
<mytree:treeview runat="server" id="oTree" treenodesrc="aspsites.XML"
treenodetypesrc="aspsitestypes.XML" ChildType="Folder" />
</form>
</body>
</html>

Two xml files that are in use:
aspsites.XML
<?xml version="1.0" encoding="utf-8" ?>
<TREENODES>
<treenode text="ASP.Net Sites" ChildType="Link">
<treenode text="ASP Alliance" navigateurl="http://www.aspalliance.com" />
<treenode text="4GuysFromRolla" navigateurl="http://www.4guysfromrolla.com"
/>
<treenode text="DotNetJunkies" navigateurl="http://www.navigateurl.com" />
</treenode>
<treenode text="Sql Server Sites" ChildType="Link">
<treenode text="Swynk" navigateurl="http://www.swynk.com" />
<treenode text="Sql-Server-Performance.com test"
navigateurl="http://www.sql-server-performance.com" />
</treenode>
</TREENODES>
aspsitestypes.XML:
<?xml version="1.0" encoding="utf-8" ?>
<TREENODETYPES>
<treenodetype Type="Folder" ExpandedImageUrl="images/openfolder.gif"
ImageUrl="images/closedfolder.gif" />
<treenodetype Type="Link" ImageUrl="images/link.gif" />
</TREENODETYPES>

The error:

Server Error in '/treeview1' Application.
----------------------------------------------------------------------------
----

The data at the root level is invalid. Line 1, position 1.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Xml.XmlException: The data at the root level is
invalid. Line 1, position 1.

Source Error:


An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:


[XmlException: The data at the root level is invalid. Line 1, position 1.]
System.Xml.XmlTextReader.ParseRoot() +295
System.Xml.XmlTextReader.Read() +127
Microsoft.Web.UI.WebControls.TreeView.ReadXmlSrc(String TreeNodeSrc,
String TreeNodeXsltSrc, String strOuter) +126
Microsoft.Web.UI.WebControls.TreeView.ReadTreeNodeTypeXmlSrc() +35
Microsoft.Web.UI.WebControls.TreeView.OnInit(EventArgs e) +83
System.Web.UI.Control.InitRecursive(Control namingContainer) +240
System.Web.UI.Control.InitRecursive(Control namingContainer) +178
System.Web.UI.Control.InitRecursive(Control namingContainer) +178
System.Web.UI.Page.ProcessRequestMain() +174





----------------------------------------------------------------------------
----

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573

Any idea?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top