ASP.Net error while migrating website to a new server

149 Views Asked by At

I was migrating my site to a new server, it's in .NET and I don't have much experience with the language. However I tried searching for the fix but had no success. Can someone help?

The error:

compiler Error Message: ASPNET: 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).

Source Error:

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

There are 2 best solutions below

0
Conrad Lotz On

Ensure that the Inherits property and the class defined in this code file uses the same name and try and add the namespace before the class name e.g. 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).

0
pawciu On

If you have already checked: inherits attribute, codefile attribut, namespaces, and you still have problem it might be web.config issue (pageBaseType).

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