/// <summary>
/// 递归构建节点树
/// </summary>
private void CreateNode(string id,TreeNode td)
{
Microsoft.Web.UI.WebControls.TreeNode tempNode=null;
string selectString=null;
string strNodeText=null;
string strChildId=null;
selectString="Menu_Parent=" + id + "";
DataRow[] dataRows = treeDataSet.Tables["menuTable"].Select(selectString); //搜索当前节点的所有子节点
foreach(DataRow dr in dataRows)
{
tempNode = new Microsoft.Web.UI.WebControls.TreeNode();
strNodeText = dr["Menu_Name"].ToString();
strChildId = dr["id"].ToString();
tempNode.Text = strNodeText;
td.Nodes.Add(tempNode); //添加子节点
CreateNode(strChildId,tempNode);
}
}