Having a difficulty working with the Treeview Web Control

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Having a difficulty working with the Treeview Web Control

    Hi,

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

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

    cu
    Bjoern Wolfgardt


    "Howard, Brett" <brett.howard@NOSPAMtroutmansanders.com> schrieb im
    Newsbeitrag news:udjoN84SDHA.3144@tk2msftngp13.phx.gbl...
    > 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(S tring 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(Event Args 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 Guest

  2. Similar Questions and Discussions

    1. TreeView in Web Custom Control
      Hi. I'm trying to develop a web custom control that uses a programmatically created treeview. My problem is that I get an exception when I try to...
    2. Difficulty getting CFCHART working
      I'm trying to get ColdFusion to produce a simple line chart. There are two issues here, perhaps related. First, there's nothing displayed on the...
    3. Adding contextmenu to IE Treeview Control
      Does anybody have a clue as to how to do this? I would like to display my own custom context menu when rightclicking a node in my treeview, but...
    4. ASP TreeView Control
      Hi I am using ASP Tree View Control to display data in hiearchy fashion.I am having a checkbox next to the TreeView Node.When user checks or...
    5. TreeView Control
      Vijay, You can use the TreeView webcontrol that comes with the iewebcontrols which are downloadable from MS site. They are 'unsupported',...
  3. #2

    Default Re: Sorry for cross posting did not know that webcontrols had a different group until after I posted this one(eom)



    Howard, Brett Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139