上边的问题解决了。又出新问题了。
分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。 分析器错误信息: 未能加载类型“shark.TreeView.DocTree”。源错误:
行 1: <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
行 2: <%@ Page language="c#" Codebehind="DocTree.aspx.cs" AutoEventWireup="false" Inherits="shark.TreeView.DocTree" %>
行 3: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
行 4: <HTML>
源文件: D:\Inetpub\wwwroot\Doctree\DocTree.aspx 行: 2
分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。 分析器错误信息: 未能加载类型“shark.TreeView.DocTree”。源错误:
行 1: <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
行 2: <%@ Page language="c#" Codebehind="DocTree.aspx.cs" AutoEventWireup="false" Inherits="shark.TreeView.DocTree" %>
行 3: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
行 4: <HTML>
源文件: D:\Inetpub\wwwroot\Doctree\DocTree.aspx 行: 2
看来不是
using System.IO;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Web.UI.WebControls;namespace shark.TreeView
{
/// <summary>
/// Summary description for DocTree.
/// </summary>
public class DocTree : System.Web.UI.Page
{
protected Microsoft.Web.UI.WebControls.TreeView TreeCtrl;
public DocTree()
{
Page.Init += new System.EventHandler(Page_Init);
} private void Page_Load(object sender, System.EventArgs e)
{
if ( ! this.IsPostBack )
{
// add tree node "type" for folders and files
string imgurl = "/shark/webctrl_client/1_0/Images/";
TreeNodeType type; type = new TreeNodeType();
type.Type = "folder";
type.ImageUrl = imgurl + "folder.gif";
type.ExpandedImageUrl = imgurl + "folderopen.gif";
TreeCtrl.TreeNodeTypes.Add( type );
type = new TreeNodeType();
type.Type = "file";
type.ImageUrl = imgurl + "html.gif";
TreeCtrl.TreeNodeTypes.Add( type );
// start the recursively load from our application root path
// (we add the trailing "/" for a little substring trimming below)
GetFolders( MapPath( "~/./" ), TreeCtrl.Nodes ); // expand 3 levels of the tree
TreeCtrl.ExpandLevel = 3;
}
} private void Page_Init(object sender, EventArgs e)
{
InitializeComponent(); } // recursive method to load all folders and files into tree
private void GetFolders( string path, TreeNodeCollection nodes )
{
// add nodes for all directories (folders)
string[] dirs = Directory.GetDirectories( path );
foreach( string p in dirs )
{
string dp = p.Substring( path.Length );
if ( dp.StartsWith( "_v" ) )
continue; // ignore frontpage (Vermeer Technology) folders
nodes.Add( Node( "", p.Substring( path.Length ), "folder" ) );
} // add nodes for all files in this directory (folder)
string[] files = Directory.GetFiles( path, "*.aspx" );
foreach( string p in files )
{
nodes.Add( Node( p, p.Substring( path.Length ), "file" ) );
} // add all subdirectories for each directory (recursive)
for( int i = 0; i < nodes.Count; i++ )
{
if ( nodes[ i ].Type == "folder" )
{
GetFolders( dirs[ i ] + "\\", nodes[i ].Nodes );
}
}
} // create a TreeNode from the specified path, text and type
private TreeNode Node( string path, string text, string type )
{
TreeNode n = new TreeNode();
n.Type = type;
n.Text = text;
if ( type == "file" )
{
// strip off the physical application root portion of path
string nav = "/" + path.Substring( MapPath( "/" ).Length );
nav.Replace( '\\', '/' );
n.NavigateUrl = nav;
// set target if using FRAME/IFRAME
n.Target="doc";
}
return n;
} #region Web Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load); }
#endregion
}
}
人兄,先别倒,说具体点。
???System.Web.UI.WebControls ??意思? 你说这里有问题?