Tree View: "Expand All" and "Collapse All" functionality to show/hide content

How does MSDN program the main frame to "Expand All" and "Collapse All" the content?

How do they get the content into the Tree View?

Is this even using Tree View Class to do this?

Here is a link to the TreeViewClass:

I figured out how to pull a treeview from a database, but can't figure out how to get the page content into the leaf nodes.

Who is Participating?
Ajay SharmaCommented:
You can use javascript to do this.

Make a DIV tag in the right side of page, name it DivMain.

Then on the tree node click u can call a javascript method to fill the DIV tag with the desired page.

In the tree node generation put this method
treenode1.Attributes.Add("OnClientClick ", "loadPage(""something.aspx"",""680"",""400"");")


put this code in the head tag :
<script language="javascript">
     function loadPage(url,wid,hig)
      document.getElementById('DivMain').innerHTML = "<iframe allowtransparency='true'  src='"+url+"' frameborder='no' width='"+wid+"' height='"+hig+"'></iframe>";


Vivek ThangaswamyCommented:

Hope this article may help you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.