1

我已经这样做了几个小时,并且一直出现同样的错误。我不知道为什么!我设法为母版页创建了第一个网络表单。不知何故,子序列网络表单出现了同样的错误。

这是我创建的网络表单:

<%@ 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
    {
    }
}

谁能解释为什么有时网络表单有效,有时却无效。

更新2:更多错误:

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">;
4

1 回答 1

0

您的 Global.asax 应如下所示:

<%@ Application Inherits="mainWebsite_EID_Shop_.Global" %>

和 Global.asax.cs:

namespace mainWebsite_EID_Shop_
{
    public class Global
    {
    }
}
于 2012-06-22T16:29:15.047 回答