我有一個ASP.NET 3.5 Web應用程序項目,我試圖實現可搜索的GridView。我最初是作爲一個網站開始項目,並將其轉換爲一個Web應用程序。轉換後,我的課程結束於文件夾Old_App_Code,名爲SearchGridView.vb。在項目級導入中指定的名稱空間或類型不包含公共成員
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Drawing.Design
<Assembly: TagPrefix("MyApp.WebControls", "SearchGridView")>
Namespace MyApp.WebControls
#Region "TemplateColumn"
Public Class NumberColumn
Implements ITemplate
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
End Sub
End Class
#End Region
<ToolboxData("<{0}:SearchGridView runat=server></{0}:SearchGridView>")> _
<ParseChildren(True, "SearchFilters")> _
Public Class SearchGridView
Inherits GridView
類文件繼續,但這是它的第一部分。
不幸的是,我收到錯誤消息 警告1項目級別中指定的名稱空間或類型Imports'MyApp.WebControls'不包含任何公共成員或無法找到。確保命名空間或類型已定義並且至少包含一個公共成員。確保導入的元素名稱不使用任何別名。 DielWebProj
在web.config中,我爲MyApp.WebControls提供了一個名稱空間標記,同時我還在.aspx頁面中包含了一個imports標記。
任何人都可以闡明爲什麼會出現這個錯誤,我會如何補救?
感謝, 希德