古墓迷津 请高手指点迷津

来源:互联网  时间:2016/7/16 14:47:19

关于网友提出的“古墓迷津 请高手指点迷津”问题疑问,本网通过在网上对“古墓迷津 请高手指点迷津”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题:古墓迷津 请高手指点迷津
描述:

我想设计一个自定义的空间,可总是提示“Could not load type 'Telerik.ActiveSkill.UI.Controls.CategoriesTree'”.请高手指点。
源码如下:
CategoriesTree.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CategoriesTree.ascx.cs"
  Inherits="Telerik.ActiveSkill.UI.Controls.CategoriesTree" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%--Drop down treeview--%>
<>
  Text="Select a Category"
  AllowCustomText="True" 
  DropDownWidth="300px" 
  Width="300px" 
  >
  
    
  

  
  
       
    <>
      DataFieldID="ID" 
      DataFieldParentID="ParentID"
      DataTextField="Title" 
      DataValueField="ID" 
       />        />        />        />       > 
    
    
    


    
  
  
  
  

<%--Stand alone treeview--%>
<>
  DataFieldID="ID" 
  DataFieldParentID="ParentID"
  DataTextField="Title" 
  DataValueField="ID" 
   />    />   >

CategoriesTree.ascx.cs源码:
using System;
using System.Data;
using Telerik.Web.UI;
namespace Telerik.ActiveSkill.UI.Controls
{
    public partial class CategoriesTree : System.Web.UI.UserControl
    {
        protected global::Telerik.Web.UI.RadComboBox cboxCategories;
        protected global::Telerik.Web.UI.RadTreeView StandAloneTreeView;
        
        
        #region properties
        // "DisplayMode" is used to signal which treeview we're 
        // showing, the one within the combo or the stand alone 
        // version.
        public enum DisplayModes { DropDown, TreeViewOnly };
        const string DisplayModeKey = "DisplayModeKey";
        public DisplayModes DisplayMode
        {
            get
            {
                return ViewState[DisplayModeKey] == null ?
                  DisplayModes.TreeViewOnly : (DisplayModes)ViewState[DisplayModeKey];
            }
            set
            {
                ViewState[DisplayModeKey] = value;
            }
        }
        // returns the visible treeview as controlled by
        // the DisplayMode
        public RadTreeView TreeView
        {
            get
            {
                return this.DisplayMode == DisplayModes.DropDown ?
                  this.cboxCategories.Items[0].FindControl("DropDownTreeView") as RadTreeView :
                  this.StandAloneTreeView;
            }
        }
        // true if the root node of the tree is selected
        public bool IsRootSelected
        {
            get { return TreeView.SelectedValue == "-1"; }
        }
        // Returns the category id stored in the selected
        // node's value. Used by data source parameters.
        public string CategoryID
        {
            get { return TreeView.SelectedValue; }
            set { TreeView.SelectedNode.Value = value; }
        }
        // Returns the parent category id stored in the selected
        // node's, parent node value. Used by data source parameters.
        public string ParentCategoryID
        {
            get { return TreeView.SelectedNode.ParentNode.Value; }
        }
        #endregion properties
        #region public methods
        // Allow consumers of this control to insert a node. 
        public void InsertCategoryNode(string title, string description)
        {
            // create new node and move selection to new node before inserting
            RadTreeNode node = new RadTreeNode(title);
            node.ToolTip = description;
            TreeView.SelectedNode.Nodes.Add(node);
            node.Selected = true;
            node.ParentNode.ExpandChildNodes();
        }
        // Allow consumers of this control to delete a node
        public void DeleteCategoryNode()
        {
            RadTreeNode parentNode = TreeView.SelectedNode.ParentNode;
            TreeView.SelectedNode.Remove();
            if (parentNode != null)
            {
                parentNode.Selected = true;
            }
        }
        // Allow consumers of this control to update a node
        public void UpdateCategoryNode(string title, string description)
        {
            TreeView.SelectedNode.Text = title;
            TreeView.SelectedNode.ToolTip = description;
        }
        // Allow consumers of this control to initialize the 
        // control with data. Note: there is a dependency here
        // that the data have column names corresponding to the
        // treeview Data properties, i.e. DataTextField, etc.
        public void InitialLoad(object dataSource)
        {
            TreeView.DataSource = dataSource;
            TreeView.DataBind();
            TreeView.Nodes[0].Selected = true;
        }
        #endregion
        #region events
        // Reuse the same event type as the tree view itself    
        public event RadTreeViewEventHandler NodeClick;
        #endregion events
        #region page events
        protected void Page_Load(object sender, EventArgs e)
        {
            // make the appropriate controls visible based on DisplayMode
            this.cboxCategories.Visible = this.DisplayMode == DisplayModes.DropDown;
            this.StandAloneTreeView.Visible = this.DisplayMode == DisplayModes.TreeViewOnly;
        }
        // allow the consumer of this control to respond to tree view node clicks
        protected void CategoriesNodeClick(object sender, RadTreeNodeEventArgs e)
        {
            if (NodeClick != null)
            {
                NodeClick(sender, e);
            }
        }
        // Save the category ID in the value of the node. Also store
        // the category description in the tooltip.
        protected void CategoriesNodeDataBound(object sender, RadTreeNodeEventArgs e)
        {
            DataRowView drv = e.Node.DataItem as DataRowView;
            e.Node.ToolTip = drv["Description"].ToString();
            e.Node.Value = drv["ID"].ToString();
            e.Node.Expanded = true;
        }
        #endregion
    }
}

上一篇怎么样跳转到另外一个页面而页面不刷新
下一篇|zyciis| 不给html控件添加runat = server 那能给他赋值吗,谢谢
明星图片
相关文章
《古墓迷津 请高手指点迷津》由码蚁之家搜集整理于网络,
联系邮箱:mxgf168#qq.com(#改为@)