public ActionResult Content()
        {
            SampleTree st   = new SampleTree();
            var        tree = st.Tree;

            var    js = tree.Select(x => new { id = x.Id.ToString(), text = x.Name, parent = x.ParentId.HasValue ? x.ParentId.Value.ToString() : "#", position = x.Order }); // ToArray() is not neccessary
            string r  = JsonConvert.SerializeObject(js);

            return(View((object)r));
        }
예제 #2
0
        public ActionResult JsData()
        {
            SampleTree st = new SampleTree();

            return(View());
        }