コード例 #1
0
        public void TreeViewExpandNode(HttpContext context)
        {
            // Get the path to the tree view node
            // from the http request's parameters.
            string path = context.Request.Params["Path"];

            // Get the id of the tree view
            // from the http request's paramters.
            string idTreeView = context.Request.Params["IdTreeView"];

            if (HttpContext.Current.Session["TreeView" + idTreeView] == null)
            {
                return;
            }

            TreeView treeView = (TreeView)HttpContext.Current.Session["TreeView" + idTreeView];

            TreeViewNode node = treeView.Select(path);

            if (node == null)
            {
                return;
            }

            node.Expanded = true;

            Panel pnlChildNodes = node.RenderChildNodes(true);

            context.Response.Write(pnlChildNodes.ToHtml());
        }