private void LoadCategories() { //转换目录信息列表至树形节点列表 List <RecursiveCategoryData> listRecursive = LocalUtils.ConvertCategoryListToRecursiveList(PortalCategoryList); RecursiveCategoryItem m_recursiveCategoryRoot; m_recursiveCategoryRoot = RecursiveHelper.ConvertListToRecursiveItem(listRecursive); RecursiveHelper.ConvertRecursiveItemToAspNetTree(ref tvCategory, m_recursiveCategoryRoot); List <CategoryInfo> list = CategoryController.ListByPortals(PortalId); for (int i = 0; i < list.Count; i++) { list[i].Name = Utils.FormatLevelName(list[i].Name, list[i].Level, ".."); } List <RecursiveCategoryData> listRecursiveData = new List <RecursiveCategoryData>(); listRecursiveData = LocalUtils.ConvertCategoryListToRecursiveList(list); RecursiveCategoryItem orderedItems = RecursiveHelper.ConvertListToRecursiveItem(listRecursiveData); ArrayList listCategory = orderedItems.GetListOrdered(); RecursiveCategoryItem a = new RecursiveCategoryItem(); a.Id = -1; a.Name = Localization.GetString("SelectCategory.Text", this.LocalResourceFile); listCategory.Add(a); ddlCategory.DataSource = listCategory; ddlCategory.DataBind(); ddlCategory.SelectedValue = "-1"; }