treeview不能正常运行???
<%@ Page language="c#" src="mytxltest.aspx.cs" AutoEventWireup="false" Inherits="mytxl.test" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>test</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<iewc:TreeView id="mydqdm" runat="server" DefaultStyle="color:#000000;border:solid 1px #ffffff;background-color:#ffffff;"
ExpandedImageUrl="img/open.gif" HoverStyle="color:#000000;border:solid 1px #555588;background-color:#f0f0f0;"
ImageUrl="img/close.gif" SelectedStyle="color:#000000;border:solid 1px #333399;background-color:#e0e0ff;"
ExpandLevel="2" ShowToolTip="False"></iewc:TreeView>
</FONT>
</form>
</body>
</HTML>
//cs文件
using System;
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 mytxl
{
/// <summary>
/// test 的摘要说明。
/// </summary>
public class test : System.Web.UI.Page
{
protected Microsoft.Web.UI.WebControls.TreeView mydqfb;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!this.Page.IsPostBack)
{
//生成外部通讯录各公司的根节点
Microsoft.Web.UI.WebControls.TreeNode tnRoot = new Microsoft.Web.UI.WebControls.TreeNode();
tnRoot.Text = "外部通讯录";
tvClient.Nodes.Add(tnRoot);
//获得当前所有公司信息
string yhdm = Session["yhdm"].ToString();
string mysql = "";
if(yhdm=="00000000")
{
mysql = "select I_QH,V_MC from PT_TXL_WBGS";
}
else
{
mysql = "select I_QH,V_MC from PT_TXL_WBGS where I_QH=(select i_bmdm from pt_yhmc where v_yhdm='"+yhdm+"')";
}
SqlConnection con = new SqlConnection("server=localhost;database=sms;uid=sa;pwd=sa");
SqlCommand mycmd = new SqlCommand(mysql,con);
DataSet ds = new DataSet();
SqlDataAdapter myAdapter;
myAdapter.Fill(ds,"dqdm");
DataTable dt = ds.Tables.Item("dqdm");
foreach(DataRow dr in dt.Rows)
{
tvClient = new Microsoft.Web.UI.WebControls.TreeNode();
tvClient.Text = dr["V_MC"].ToString();
tvClient.Target = "LinkmanList";
tvClient.NavigateUrl = strUrl + "?iClient=" + dr["I_ID"].ToString() + "&strClientName=" + dr["V_MC"].ToString();
tnRoot.Nodes.Add(tvClient);
}
}
}
}
}
运行时总是提示我类型或命名空间名称“Web”在类或命名空间“Microsoft”中不存在(是否缺少程序集引用?)
请问这个问题怎么解决啊,谢谢。