This project is read-only.

Make sure that the class defined in this code file

Feb 20, 2012 at 11:33 AM

Hello to every one!!

Help im sleepless.....


This is my code behind


Imports Facebook_Graph_Toolkit

Partial Public Class _Default
    Inherits CanvasPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        If Not IsAuthorized Then
            NoAuthDisplay.Visible = True
            NoAuthDisplay.Visible = False
        End If
    End Sub

End Class


And this is my aspx page


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <div id="NoAuthDisplay" runat="server">
    <p>To access all the features of the app, you must first authorize it.</p>

And this is my result

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: 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:  Imports Facebook_Graph_Toolkit
Line 2:  
Line 3:  Partial Public Class _Default




and again


Can someone help me out

Feb 20, 2012 at 10:38 PM

I just did a Google search for "Make sure that the class defined in this code file matches the 'inherits' attribute" and got a ton of hits. I recommend pasting that text into Google and see what you come up with. The answer could be anything like a missing attribute in the %@Page tag, ensuring you're referencing the library, and (!) checking to see if you have some other file with the same CodeFile or class name. Some people say this came up after they copied some pages around or renamed files, etc.  I think there was also a bug in VS2005 or early VS2008 that might have caused this to appear.

Really, Google that first, then let us know here if you found a solution.