2010-09-19 64 views
0

我收到这个错误,不能找出问题所在。运行我的Asp.net 4应用程序时出错

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  

背后语法的代码是:

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

     } 
    } 
} 
+0

您能否从代码隐藏文件中显示类JobSearchManager.Contact的声明? – 2010-09-19 18:47:56

+0

这不是你的代码。这是一个内容页面。向我们展示你的代码。 – 2010-09-19 19:41:42

回答

1

我建议你删除并重新添加你的表单,如果你没有做过多的修改。

我觉得这个问题是由部分类造成的。让我解释。你可以看到你的班级被定义为部分班级。

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

因此,可能有Contract类的另一部分,并且该部分可能被损坏或从另一个类派生。你可以检查这个。

0

嘛错误似乎告诉你,你的JobManager.Contact类不是从System.Web.UI.Page类或其后代的一个继承。

所以是不是

如果是这样,那么你将不得不提供一些你的代码,例如你的页面类定义。我们将从那里开始。

0
  • 检查是否与另一个程序集有名称空间冲突。
  • 同时删除你的bin目录并重建你的项目。
相关问题