【发布时间】:2012-06-24 23:48:18
【问题描述】:
我已经这样做了好几个小时了,它总是出现同样的错误。我不知道为什么!我设法为母版页创建了第一个网络表单。不知何故,子序列网络表单出现了同样的错误。
这是我创建的网络表单:
<%@ Page Title="" Language="C#" MasterPageFile="~/EIDShopMain.Master" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="mainWebsite_EID_Shop_.WebForm3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
当我想在浏览器中查看时:
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: Could not load type 'mainWebsite_EID_Shop_.Global'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="mainWebsite_EID_Shop_.Global" Language="C#" %>
更新:这是一个 ASP.Net Web 应用程序项目。
WebForm3 的代码隐藏:
namespace mainWebsite_EID_Shop_
{
public partial class WebForm3 : Page
{
}
}
谁能解释为什么网络表单有时有效,有时无效。
Update2:更多错误:
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: Could not load type 'mainWebsite_EID_Shop_.EIDShopMain'.
Source Error:
Line 1: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="EIDShopMain.master.cs" Inherits="mainWebsite_EID_Shop_.EIDShopMain" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">;
【问题讨论】:
-
是Web App项目还是网站项目?
-
另外请发布您的代码隐藏文件。
-
如您所见,错误在 Global.asax,而不是 WebForm3.aspx
-
在你告诉我之前,我不记得有 Global.asax。我认为没用,所以我删除了它们....现在又出错了!天哪。
-
删除 Global.asax.* 时出现什么错误?
标签: c# asp.net .net exception-handling master-pages