1
votes

I have searched through Stackoverflow, Google, and tried different configurations like CodeFile rather than CodeBehind. The error changes slightly but still get it, really stuck on this one. Any help will be appreciated. The exact error is below, my code for that error is below that.

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 'BestPricingEngine.Main'.

Source Error:

Line 1: <%@ Page Title="Import FBA Orders" Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/MasterPage.Master" CodeBehind="ImportFBAOrders.cs" Inherits="BestPricingEngine.Main" %> Line 2: <%@ Register src="ImportFBAOrders.ascx" tagname="ImportFBAOrders" tagprefix="ucImportFBAOrders"%> Line 3:

Source File: /Pages/ImportFBAOrders/ImportFBAOrders.aspx Line: 1

<%@ Page Title="Import FBA Orders" Language="C#" AutoEventWireup="true"  MasterPageFile="~/MasterPages/MasterPage.Master"  CodeBehind="ImportFBAOrders.cs" Inherits="BestPricingEngine.Main" %>
<%@ Register src="ImportFBAOrders.ascx" tagname="ImportFBAOrders" tagprefix="ucImportFBAOrders"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpSidebar" Runat="server">


</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cpMainContent" runat="server">
<ucImportFBAOrders:ImportFBAOrders ID="importFBAOrders" runat="server" />
</asp:Content>

ImportFBAOrders.cs

1
What is BestPricingEngine.Main? If it is a class library then should it not be BestPricingEngine.cs? I don't recognize that file extension.Lopsided
BestPricingEngine is the namespace, the Main is Main.aspx. I don't understand why it is trying to load Main therewebby68
Ah okay that makes sense. Did you try referencing the namespace with an Imports, Using, or Inherits in the code behind? If so, did you get the same error there? I'm just curious to see if it can find the namespace. Did you add the inherits attribute manually?Lopsided
CodeBehind="ImportFBAOrders.cs" Inherits="BestPricingEngine.Main" %>webby68
I have that in the code. I remove .Main and get the error that BestPricingEngine could not be loadedwebby68

1 Answers

1
votes

There should not be a period in your BestPricingEngine.Main. The Inherits attribute is normally used in the markup to reference the code-behind of that page.

In other words, looking at this code, I would assume your Inherits attribute should be named after that page's class, which is usually the path of the code-behind file delimited by underscores, and excluding the file extension.

EDIT

Change Inherits="BestPricingEngine.Main" to Inherits="BestPricingEngine.Pages"