[ASP.NET]动态绑定树控件:

[ASP.NET]动态绑定树控件:
public void BindTree(TreeView tview, TreeNode tn_main, string parentId,string sql)   
        {   
                TreeNode tn=null;   
                tview.Font.Size = FontUnit.Small;   
                tview.ForeColor = System.Drawing.Color.Black;   
                DB db = new DB();   
                DataSet ds = db.GetDataSet(sql, "table1");   
                DataTable dTable = ds.Tables[0];   
                DataRow[] drows = dTable.Select(" parentId=‘"+parentId+"");   
                foreach (DataRow drow in drows)   
                {   
                        tn = new TreeNode();   
                        tn.Text = drow["modulName"].ToString();   
                        tn.Value = drow["modulId"].ToString();   
                        tn.SelectAction = TreeNodeSelectAction.Expand;   
                        tn.NavigateUrl = "Default2.aspx";   
                        tn.Expanded = true;   
                        if (tn_main == null)   
                        {   
                                tview.Nodes.Add(tn);   
                        }   
                        else   
                        {   
                                tn_main.ChildNodes.Add(tn);   
                        }   
                        DataSet dst = db.GetDataSet(sql, "table2");   
                        DataTable dtb = dst.Tables[0];   
                        DataRow[] dar = dtb.Select(" parentId=‘" + tn.Value + "");   
                        parentId = tn.Value;   
                        BindTree(tview,tn, parentId,sql);   
                }   
        }  
[ASP.NET]动态绑定树控件:

[ASP.NET]动态绑定树控件:,布布扣,bubuko.com

[ASP.NET]动态绑定树控件:

上一篇:解决jQuery插件冲突


下一篇:jQuery1.11源码分析(2)-----Sizzle源码中的正则表达式[原创]