我正在用 ASP.Net 编写一个 Web 应用程序。
在网页的顶部,我有:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="software-mgr.aspx.vb" Inherits="ftp_access_software_mgr" EnableViewState="True" EnableSessionState="True" %>
<%
Dim ssMgr As SoftwareFTPStorage = New SoftwareFTPStorage
Dim ssDBMgr As SoftwareStoreDBTools = New SoftwareStoreDBTools
Dim username As String
username = getUserName()
If Not IsPostBack Then buildDBList()
%>
在 .aspx.vb 页面上,我有:
Imports SoftwareFTPStorage
Imports SoftwareStoreDBTools
Imports System
Imports System.Security
Imports System.Data.SqlClient
Imports System.Data.SqlClient.SqlConnection
Imports System.Data.SqlClient.SqlCommand
Partial Class ftp_access_software_mgr
Inherits System.Web.UI.Page
Dim ssDBTools As SoftwareStoreDBTools = New SoftwareStoreDBTools
Dim ssMgrTools As SoftwareFTPStorage = New SoftwareFTPStorage
Protected Sub Add_Click(sender As Object, e As System.EventArgs) Handles AddButton.Click
...Class Code
End Sub
Protected Sub RemButton_Click(sender As Object, e As System.EventArgs) Handles RemButton.Click
...Class Code
End Sub
Protected Sub buildDBList()
...Class Code
End Sub
Protected Function getUserName() As String
...Class Code
End Function
End Class
我不知道我做了什么,但在服务器上的某个时刻我开始收到错误:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'SoftwareStoreDBTools' is not defined.
Source Error:
Line 10: Inherits System.Web.UI.Page
Line 11:
Line 12: Dim ssDBTools As SoftwareStoreDBTools = New SoftwareStoreDBTools
Line 13: Dim ssMgrTools As SoftwareFTPStorage = New SoftwareFTPStorage
Line 14:
当我在本地调试时,它工作得很好......好吧,排序:仍在解决一些“状态”问题,但至少我没有得到错误页面。
有任何想法吗?