About TreeView WebControl currently does not support Microsoft® Internet Explorer WebControl. (This article contains some links to English sites.)
This article describes the use of the TreeView control, which can be used to help generate a user interface to display a hierarchical dataset, folder view, and other similar data structures. This control has a variety of powerful features, including supporting data binding and high-altitude browser enriched dynamic HTML (DHTML) behavior. In most cases, TreeView can be created by declaring; however, this control can be implemented in a variety of ways on the client or server. This article includes the following:
Introduction Prerequisite Terminology TreeView Object TreeView Element Writing Simple TreeView Format Setting Data Binding Programming Performance Tips Related Topics TreeView is an ASP.NET server control to generate a user interface for displaying hierarchical data. Like other Microsoft® Internet Explorer WebControl, the TreeView control will also send HTML according to the type of browser. In the lower browser, the page content sent by the TreeView ASP.NET server control is HTML 3.2 format, and in the Advanced Browser, the HTML page also uses DHTML behavior, and the DHTML behavior is a client component that defines a custom element. For WebControl, advanced browsers refer to Internet Explorer 5.5 or higher, the low-level browser refers to Internet Explorer 5.01 or lower, or other browsers other than Internet Explorer. This article describes how to create and use the TreeView control by actual example. TreeView is one of four WebControl; therefore, you want to create a web page containing these controls, which are similar to each other. For general information about WebControl, including Download and Installations, see Internet Explorer WebControls and Authoring Web Forms with the WebControls. WebControl is an ASP.NET server control with a set of DHTML behaviors that provide a wealth of user experience in the advanced browser. For each WebControl, a DHTML behavior corresponds to a client object model, which corresponds to the server-side object model implemented by the ASP.NET server control. Internet Explorer 5.5 has a significant difference in the component architecture in ASP.NET, so the object model corresponding to the client object and the server-side object is slightly different. At the same time, using client components and server-side components means that you can create a web page using TreeView in two modes. In ASP.NET, you can use the behavior in the Advanced browser to write a web form to send content based on the browser performance. These pages can take advantage of server-side scripts written in a library language in a public language. For Internet Explorer 5.5 or higher, you can write a web page that contains DHTML behavior using the client script. Prerequisites To understand this article, you need to be familiar with the basic type of the ASP.NET control and learn how to create a simple web form page. In addition, there are some knowledge about the writing of browser scripts and DHTML behavior, as WebControl uses these behaviors in the advanced browser. The code example in this article is written with Microsoft C # and Microsoft Visual Basic® .net. These examples are easily understood even if the web developers understand the ASP.NET and the public language runtime. For more information on creating a Web page with ASP.NET and WebControl, see Internet Explorer WebControl. the term
The term description web form ASP.NET Web Form Frame is an extensible public language runtime programming model that can be used to dynamically generate a web page. The web form is .aspx file, analyzed and processed by ASP.NET. WebControl is a custom ASP.NET control that creates a page in a web form environment. TreeView Object This section provides a basic different point implementation of the client and server-side TreeView implementation. You can access the reference documentation for the client and server-side objects involved in the TreeView component via the TreeView Reference page. You can also use the TreeView Editor (TreeView Editor) in Visual Studio .NET to intuitively create the TreeView control. This article mainly introduces the method of manually created content using TreeView. For more information on intuitive editing TreeView, see Using The TreeView Designer In Visual Studio .NET. You can create TreeView by declaring, or write scripts on the client or server to create this control. The examples in this article use a declaration method and use the ASP.NET TreeView server control in the Web Forms page, and TreeView behavior is used in the HTML page. Because the programming language supported by ASP.NET and Internet Explorer, the reference documentation for client components and server-side components are provided separately. ASP .NET Server Control ASP.NET Server Control provides the most complete TreeView programming model. If the web page needs to be run in a variety of browsers, it is recommended to use the ASP.NET server control. Because WebControl detects the type of browser and sends HTML 3.2 to the low browser. For more information, see ASP .NET Server Controls Reference. Client Behavior If you want to optimize client performance in Internet Explorer 5.5 or later, there is also a TreeView Behavior available. The TreeView Behavior is automatically downloaded to the Advanced Browser using WebControl's ASP.NET Web Forms. Thus, when writing the HTML page for the client only, TreeView behavior can be used independently of ASP.NET. TreeView in many Microsoft Windows® applications typically has a wealth of features, for example, you can use mice or keyboard input to expand or fold nodes in TreeView. TreeView behavior supports all of these features and can implement data binding in a client or server-based web page. TreeView elements You can create TreeView using one or more of the following elements supported by the client and server-side TreeView components.
Element Name Description TreeView defines a TreeView. TREENODETYPE defines a node type for one or a set of nodes in TreeView. Treenode creates a node in TreeView. We offer a reference documentation for use TreeView ASP.NET Server Controls and TreeView Behaviors. For more information, see the TreeView Reference page. The TreeView element is the container of Treenode and Treenodetype elements. These elements jointly define the structure, layout and appearance of the tree view. TreeView cannot contain any other HTML content other than these three elements. The TreeView element can contain any number of TREENODETYPE elements, as long as the client and the host have sufficient resources. The TreenodeType element is used to define the style, images, and other behaviors of the Treenode element. You can group TREENODE elements through elementality to set and modify their formats using the TREENODETYPE element. The TreenOdetype element must be a child element of the TreeView element, and must appear before the first Treenode element. The Treenode element can only contain other TREENODE elements. However, by specifying the HTML content to the TEXT property of the Treenode element, the content can be embedded in TreeView. The TEXT content of the Treenode element will be displayed as HTML instead of plain text. Write simple TreeView This section describes the steps to create a simple TreeView. You can use any text editor to perform all steps. To complete the following procedure, you need to install WebControl. For more information, see Internet Explorer WebControls Overview. Create a web application. This Web should be named WebControls because all examples in this article use it. To make WebControl function properly, you must configure the new Web as a web application. Create a blank web form page. Add a new file to the Web and save it as Tree1.aspx. Add import instructions. Write the import instruction code of WebControl in the first line of the web form, as shown below: <% @ import namespace = "Microsoft.Web.ui.WebControls"%>
Add @ register command. Write WebControl's @ register instruction code in the second line of the web form. <% @ Register tagprefix = "mytree"
Namespace = "Microsoft.Web.ui.WebControls"
AskMBLY = "Microsoft.Web.ui.WebControls, Version = 1.0.2.226, Culture = neutral, publickeyToken = 31BF3856AD364E35"%>
Add a document structure. Add the following below the @register command to provide a basic document structure.
hEAD> body>Html>
Add an FORM element. All WebControl elements must be established in an Form element; therefore, the following tags are added to the Document Body.