Note that there are some explanatory texts on larger screens.

plurals
  1. POWhile binding Treeview control to xmldatasource, "Exception:Root element is missing " is occured
    primarykey
    data
    text
    <p>aspx file:</p> <pre><code> &lt;div&gt; &lt;asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1" ShowCheckBoxes="All" ShowLines="True"&gt; &lt;/asp:TreeView&gt; &lt;asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/Details.xml"&gt; &lt;/asp:XmlDataSource&gt; &lt;/div&gt; </code></pre> <p>Deatails.xml:</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt; &lt;Root&gt; &lt;Collection Name="Server 1"&gt; &lt;Box&gt;MB1&lt;/Box&gt; &lt;Box&gt;MB2&lt;/Box&gt; &lt;Box&gt;MB3&lt;/Box&gt; &lt;Box&gt;MB4&lt;/Box&gt; &lt;Box&gt;MB5&lt;/Box&gt; &lt;/Collection&gt; &lt;/Root&gt; </code></pre> <p>Stack Trace: </p> <pre><code> [XmlException: Root element is missing.] System.Xml.XmlTextReaderImpl.Throw(Exception e) +76 System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) +61 System.Xml.XmlTextReaderImpl.ParseDocumentContent() +3981048 System.Xml.XmlTextReaderImpl.Read() +151 System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) +58 System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +20 System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +129 System.Xml.XmlDocument.Load(XmlReader reader) +108 System.Web.UI.WebControls.XmlDataSource.PopulateXmlDocument(XmlDocument document, CacheDependency&amp; dataCacheDependency, CacheDependency&amp; transformCacheDependency) +306 System.Web.UI.WebControls.XmlDataSource.GetXmlDocument() +153 System.Web.UI.WebControls.XmlHierarchicalDataSourceView.Select() +17 System.Web.UI.WebControls.TreeView.DataBindNode(TreeNode node) +125 System.Web.UI.WebControls.TreeView.PerformDataBinding() +120 System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +85 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 System.Web.UI.WebControls.TreeView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22 System.Web.UI.WebControls.TreeView.OnPreRender(EventArgs e) +36 System.Web.UI.Control.PreRenderRecursiveInternal() +80 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842 </code></pre> <p>While loading the page the exception is thrown, I tried to validate the xml file &amp; its valid according to w3cshools validator. What things do cause this exception. Correct me where I went wrong. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload