0

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">
John Saunders
  • 160,644
  • 26
  • 247
  • 397

2 Answers2

0

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).

Conrad Lotz
  • 8,200
  • 3
  • 23
  • 27
0

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" />
...
pawciu
  • 855
  • 9
  • 15