将网站迁移到新服务器时出现ASP.Net错误

时间:2012-09-12 19:12:29

标签: asp.net .net server-migration

我正在将我的网站迁移到新服务器,它是在.NET中,我对该语言没有多少经验。但是我尝试寻找修复但没有成功。有人可以帮忙吗?

错误:

  

编译器错误消息:ASPNET:确保在中定义的类   此代码文件与'inherits'属性匹配,并且它会扩展   正确的基类(例如Page或UserControl)。

来源错误:

Line 1:  <%@ Page Title="" Language="VB" MasterPageFile="~/EnjoyMaster2.master" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
Line 2:  
Line 3:  <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

2 个答案:

答案 0 :(得分:0)

确保Inherits属性和此代码文件中定义的类使用相同的名称,并尝试在类名之前添加命名空间,例如Inherits="namespace._Default"

Error 4 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

答案 1 :(得分:0)

如果你已经检查过:继承属性,代码文件属性,命名空间,你仍然有问题,可能是web.config问题(pageBaseType)。

<configuration>
<appSettings>
    ...
</appSettings>
<connectionStrings/>
<system.web>
    <pages pageBaseType="System.Web.UI.Page" />
...
相关问题