MetaGuru
MetaGuru

Reputation: 43863

Can someone tell me what the problem is with my class header?

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

But I am getting this error... tried making them match and everything, what is it suppose to be?

Server Error in '/' Application.
    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 14: namespace FlashCards
    Line 15: {
    Line 16:     public partial class _Default : System.Web.UI.Page
    Line 17:     {
    Line 18:         protected int indexKey = 0;


    Source File: c:\Users\Ryan\documents\visual studio 2008\websites\flashcards\Default.aspx.cs    Line: 16 

Upvotes: 0

Views: 212

Answers (1)

Mikko Rantanen
Mikko Rantanen

Reputation: 8084

Inherits requires the full name of the class so you need to include the namespace as well. Try replacing the

Inherits="_Default"
with
Inherits="FlashCards._Default"

Upvotes: 5

Related Questions