views:

46

answers:

3

I am getting this error, and cant figure out what the issue is.

    Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: 'JobManager.Contact' is not allowed here because it does not extend class 'System.Web.UI.Page'.

Source Error: 


Line 1:  <%@ Page Title="Contact" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
Line 2:      CodeBehind="Contact.aspx.cs" Inherits="JobManager.Contact" %>
Line 3:  


Source File: /Contact.aspx    Line: 1 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1    

The code behind syntax is:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace JobManager
{
    public partial class Contact : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}
A: 

Well the error seems to tell you, that your class JobManager.Contact is not inherited from System.Web.UI.Page class or one of its descendants.

So does it?

If it does, then you're going to have to provide some of your code as well, namely your page class definition for instance. We'll start from there.

Robert Koritnik
+1  A: 

Hi, I suggest you delete and add your form again, if you didn't made modifications too much.

I think this problem is caused by partial class. Let me explain. You can see your class is defined as partial class.

public partial class Contact : System.Web.UI.Page

So there can be another part of Contract class and that part can be corrupted or derived from another class. You can check this.

bahadir arslan
A: 
  • Check if you have a namespace conflict with another assembly.
  • Also delete your bin directory and rebuild your project.
chris