如下TextDrop.ascx.cs文件代碼﹕定義了控件屬性
namespace CNetComPonents.UserControls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls; /// <summary>
/// WebUserControl1 的摘要說明。
/// </summary>
public class UCPowerTextBox : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.TextBox UCTextBox;
protected System.Web.UI.WebControls.ListBox UCListBox; private void Page_Load(object sender, System.EventArgs e)
{
// 在此處放置用戶代碼以初始化頁面 UCListBox.Style.Add("visibility","hidden"); }
#region Web 窗體設計器生成的代碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 該調用是 ASP.NET Web 窗體設計器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器
/// 修改此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.Page.Load +=new EventHandler(Page_Load);
this.UCListBox.Attributes["onclick"]="javascript:UCListBox_click();";
}
#endregion public string Text
{
get
{
return UCTextBox.Text;
}
set
{
UCTextBox.Text = value;
}
}
public int Width
{
set
{
UCTextBox.Width = value; UCListBox.Width = value;
}
}
public object DataSource
{
set
{
UCListBox.DataSource = value;
}
}
public string DataTextField
{
set
{
UCListBox.DataTextField = value;
}
}
public string DataValueField
{
set
{
UCListBox.DataValueField = value;
}
}
public new void  DataBind()
{
UCListBox.DataBind();
}
public int Rows
{
set
{
UCListBox.Rows = value;
}
} }
}使用控件的例子WebForm2.aspx.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 System.Data.SqlClient;namespace UCTextBox
{
/// <summary>
/// WebForm2 的摘要描述。
/// </summary>
public class WebForm2 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// 在這裡放置使用者程式碼以初始化網頁
SqlConnection conn = new SqlConnection();

conn.ConnectionString = "Server=10.192.35.95;Uid=sa;Pwd=sa123;DataBase=dberp;"; SqlDataAdapter da = new SqlDataAdapter("select top 20 csid,cdsc from tcomclas",conn); DataSet ds = new DataSet(); da.Fill(ds); TextDrop1.DataSource = ds.Tables[0]; TextDrop1.DataValueField = "csid";
TextDrop1.DataTextField = "cdsc";
TextDrop1.DataBind();
} #region Web Form 設計工具產生的程式碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 此為 ASP.NET Web Form 設計工具所需的呼叫。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 此為設計工具支援所必須的方法 - 請勿使用程式碼編輯器修改
/// 這個方法的內容。
/// </summary>
private void InitializeComponent()
{    
this.Load += new System.EventHandler(this.Page_Load); }
#endregion
}
}
WebForm2.aspx
<%@ Register TagPrefix="uc1" TagName="TextDrop" Src="TextDrop.ascx" %>
<%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false" Inherits="UCTextBox.WebForm2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</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="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋體">
<uc1:TextDrop id="TextDrop1" runat="server"></uc1:TextDrop></FONT>
</form>
</body>
</HTML>錯誤問題﹕
D:\UCTextBox\WebForm2.aspx.cs(37): 找不到型別或命名空間名稱 'TextDrop1' (您是否遺漏 using 指示詞或組件參考?)請問這是什么原因﹐如何解決﹖