2012年2月25日

树控件,父子ID 无限级菜单

摘要: SqlConnection sqlconn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());protected void addTree(int ParentID, TreeNode pNode){//打开数据库sqlconn.Open();//把数据添加到数据表中SqlDataAdapter da = new SqlDataAdapter("select * from Departments", sqlconn);sql 阅读全文

posted @ 2012-02-25 01:27 JQuery-Ch 阅读(341) 评论(0) 推荐(0) 编辑

//将datatable转换为json

摘要: //将datatable转换为jsonpublic string DtToJson(DataTable dt){StringBuilder jsonBuilder = new StringBuilder();jsonBuilder.Append("[");for (int i = 0; i < dt.Rows.Count; i++){jsonBuilder.Append("{");for (int j = 0; j < dt.Columns.Count; j++){jsonBuilder.Append("\"") 阅读全文

posted @ 2012-02-25 01:25 JQuery-Ch 阅读(170) 评论(0) 推荐(0) 编辑

树控件,没有父子ID 实现二级菜单

摘要: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TreeView1.ShowLines = true; TreeView1.ExpandDepth = 1; TreeView1.Nodes.Clear(); addTree("省总部", (TreeNode)null); }}protected void addTree(string ParentID, TreeNode pNode) { DataTable dt = new HRService.UserInfo().getP 阅读全文

posted @ 2012-02-25 01:15 JQuery-Ch 阅读(244) 评论(0) 推荐(0) 编辑

导航