protected void btn_tree_new_Click(object sender, EventArgs e) { int pnID = PanelTree.SelectedNode.Value.ToInt32(0); int parentID = 0; try { parentID=SubTree.SelectedNode.Value.ToInt32(0); } catch { } SysNavTree tree = new SysNavTree(); tree.Group = cbl_tree_group.GetValues(); tree.Icon = ddl_tree_icon.SelectedValue; tree.InnerHtml = txt_tree_html.Text; tree.OrderIndex = txt_tree_orderindex.Text.ToInt32(); tree.PanelID = pnID; tree.ParentID = parentID; tree.Title = txt_tree_title.Text; tree.Url = txt_tree_url.Text; DataEntities ent = new DataEntities(); ent.AddToSysNavTree(tree); ent.SaveChanges(); ent.Dispose(); Js.AlertAndChangUrl("新增成功", "SysmenuManagement.aspx"); }