树形treeview控件,初始化能构造出来,加入过滤条件后就不能构造出来了
树形treeview控件,初始化能构造出来,加入过滤条件后就不能构造出来了,代码如下 请问如何修改
public static string str_wordsid,str_serch;
protected void Page_Load(object sender, EventArgs e)
{
if (!ComIP.getSession(this.Session))
{
Response.Redirect( "ksindex.aspx ");
return;
}
if (!Page.IsPostBack)
{
ViewState[ "userID "] = Security.ReverseUserId(Session[ "userID "].ToString().Trim());
ViewState[ "sysID "] = Session[ "sysID "].ToString().Trim();
CreateDropDownList(ViewState[ "sysID "].ToString());
str_serch = " ";
PopulateFunctionsTree(str_serch); //构造树的函数
}
}
private void CreateDropDownList(string str_sysID)
{
DataTable dt = new DataTable();
if ((new Items()).getSort( "sysID= " + str_sysID + " and fields= 'F17 ' ", ref dt))
{
for (int i = 0; i < dt.Rows.Count; i++)
{
this.ddl_Sort.Items.Add(new ListItem(dt.DefaultView[i][4].ToString()));
this.ddl_Sort.Items[i].Value = dt.DefaultView[i][4].ToString(); ;
}
}
}
protected void PopulateFunctionsTree(string str_serch)
{
TreeNode tn_root =