title: Dynatree using asp.net mvc3
body: <p>I am having a Dynatree that loads up data from a ASP.NET MVC3 controller. For the first call the tree needs to load data and then on wards the tree must load on an on demand basis (lazy loading). The problem I am facing is that for the first time, when the data is returned back from the controller on to the tree the data is not getting displayed properly. Basically the node names are coming NULL. But I checked the controller is returning data correctly. How do I format the data that I receive on the client side. </p>
  
  <p>I am using the following code base : </p>
  
  <pre><code>treeElement.dynatree({
              title: "Lazy loading sample",
              fx: { height: "toggle", duration: 200 },
              autoFocus: false, 
              initAjax: {
                  url: "/DataManager/ViewNodes",
                  data: { mode: 'all' }
                  //Here after I receive the data, how do I show the nodes ?? 
              },
  
              onActivate: function (node) {
                  alert(node.getKeyPath());
              },
  
              onLazyRead: function (node) {
  
                  node.appendAjax({
                      url: ""
                  });
              }
          });
  </code></pre>
  
  <p>The json that is returned from the controller is having the following structure:</p>
  
  <pre><code> [
  
    {"ChildNodes":     [],"Parent":null,"Type":9,"HasRaps":false,"HasReports":false,"TotalChildCount":0,"NodePaths":null,"ID":2,"Name":"Omega",},
  
   {"ChildNodes":[{"ChildNodes":          [],"Parent":null,"Type":0,"HasRaps":false,"HasReports":false,"TotalChildCount":0,"NodePaths":null,"ID":0,"Name":"LoadingData..."}],"Parent":null,"Type":8,"HasRaps":false,"HasReports":false,"TotalChildCount":1,"NodePaths":null,"ID":14,"Name":"PARIS"}
   ]
  </code></pre>
  
  <p>Can anyone help .</p>
  
  <p>Thanks,
  Anirban</p>