public void ParentNode() //创建父节点
{
DataSet ds = GetFunCategrory(200);
if (ds.Tables[0].Rows.Count != 0)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
TreeNode tn = new TreeNode();
tn.Text = ds.Tables[0].Rows[i]["CateGroryName"].ToString();
tn.Value = ds.Tables[0].Rows[i]["CateGroryId"].ToString();
tn.Target = "_self";
tn.NavigateUrl = "#";
TreeView1.Nodes.Add(tn);
int categroryId = Convert.ToInt32(ds.Tables[0].Rows[i]["CateGroryId"]);
ChildNode(tn,categroryId);
}
}
}
public void ChildNode(TreeNode node,int categroryId) //递归取出父节点下的子节点
{