Re: Having a difficulty working with the Treeview Web Control

Discussion in 'ASP .Net' started by Bjoern Wolfgardt, Jul 16, 2003.

  1. Hi,

    I have answered your question in:
    microsoft.public.dotnet.framework.aspnet.webcontrols

    Pls don't do crossposting. Some won't answer your request if you do
    crossposting.

    cu
    Bjoern Wolfgardt


    "Howard, Brett" <> schrieb im
    Newsbeitrag news:...
    > I am having a problem with using the Treeview Web Control. When I try to

    set
    > a tree source node to an XML file, I get the following 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)
    > Microsoft.Web.UI.WebControls.TreeNode.ReadXmlSrc()
    > Microsoft.Web.UI.WebControls.TreeNode.Databind()
    > Microsoft.Web.UI.WebControls.TreeNode.OnInit()
    > Microsoft.Web.UI.WebControls.TreeView.OnInit(EventArgs e)
    > System.Web.UI.Control.InitRecursive(Control namingContainer)
    > System.Web.UI.Control.InitRecursive(Control namingContainer)
    > System.Web.UI.Control.InitRecursive(Control namingContainer)
    > System.Web.UI.Page.ProcessRequestMain()
    >
    > This is my source code.
    > TreeViewDemo.aspx
    > <%@ register TagPrefix="myTree" Namespace="Microsoft.Web.UI.WebControls"
    > Assembly="Microsoft.Web.UI.WebControls" %>
    > <%@ Page Language="vb" AutoEventWireup="false"
    > Codebehind="TreeViewDemo.aspx.vb" Inherits="treeviewdemo.TreeViewDemo"%>
    > <!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en">
    > <HTML>
    > <HEAD>
    > <TITLE>TreeViewDemo2</TITLE>
    > <META name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    > <META name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
    > <META name=vs_defaultClientScript content="JavaScript">
    > <META name=vs_targetSchema
    > content="http://schemas.microsoft.com/intellisense/ie5">
    > </HEAD>
    > <BODY>
    > <FORM id="Form1" method="post" runat="server">
    > <DIV style="FONT-WEIGHT:bold">Static TreeView</DIV>
    > <MYTREE:TREEVIEW id="trvStatic" RUNAT="server" CHILDTYPE="Categories">
    > <MYTREE:TREENODETYPE TYPE="Categories" CHILDTYPE="Authors"/>
    > <MYTREE:TREENODETYPE TYPE="Authors" CHILDTYPE="Books"/>
    > <MYTREE:TREENODETYPE TYPE="Books" IMAGEURL="images/html.gif"/>
    > </MYTREE:TREEVIEW>
    > <DIV style="FONT-WEIGHT:bold">XML TreeView</DIV>
    > <MYTREE:TREEVIEW runat="server">
    > <MYTREE:TREENODE runat="server" text="Employees" expanded="True"
    > treenodesrc="TreeViewData.xml"/>
    > </MYTREE:TREEVIEW>
    >
    > </FORM>
    > </BODY>
    > </HTML>
    >
    > TreeViewData.xml
    > <?xml version="1.0" encoding="utf-8" ?>
    > <TREENODES>
    > <treenode text="Web Development">
    > <treenode text="Brett Howard" />
    > <treenode text="Kevin Buchan" />
    > <treenode text="Patrick Ledbetter" />
    > </treenode>
    > <treenode text="Significant others">
    > <treenode text="Marrette" />
    > <treenode text="Tiffany" />
    > <treenode text="N/A" />
    > </treenode>
    > </TREENODES>
    >
    > From the documentation that I have read, this should work. If someone can
    > help me, I will be forever grateful.
    >
    > Brett Howard
    >
    >
    Bjoern Wolfgardt, Jul 16, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samridhi Kumar Shukla
    Replies:
    1
    Views:
    522
    Alvin Bruney
    Nov 30, 2003
  2. =?Utf-8?B?SmVmZkRvdE5ldA==?=

    Difficulty disabling the read-only attribute on an ASP.net working

    =?Utf-8?B?SmVmZkRvdE5ldA==?=, Mar 22, 2007, in forum: ASP .Net
    Replies:
    7
    Views:
    537
    Walter Wang [MSFT]
    Mar 28, 2007
  3. naija naija

    TreevIew having hyperlinks in the submenu

    naija naija, Sep 8, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    138
    naija naija
    Sep 8, 2004
  4. Ionutz
    Replies:
    2
    Views:
    528
    Ionutz
    Oct 23, 2005
  5. Andrew Falanga
    Replies:
    5
    Views:
    91
    David Mark
    Nov 22, 2008
Loading...

Share This Page