Dynamic binding to a TreeView control in ASP.NET 2.0 and navigating child nodes with JavaScript

This article explains dynamic binding to a TreeView control in ASP.NET 2.0 and navigating child nodes using JavaScript.

Introduction

Here is the code for dynamic binding of a TreeView and also the server-side JavaScript for the navigating URL to the child nodes.

I have gone through many forums to get information on the TreeView control. The only bug I found is the _dopostback JavaScript that stops the navigating URL of the child nodes. Many suggested it would be to better go for the autopostback property to be set as true. But the TreeView control doesn't have an autopostback property.

An optional way is to use the JavaScript window.open() function. I have listed the source code below, but you will have to write your own Stored Procedures for youur databases.

A requirement to bind a TreeView control would be that the table should maintain relations and should possess unique fields to make relations.